Documentation ¶
Index ¶
- Constants
- func ValidateCIDR(cidr string) (*net.IPNet, error)
- type NSNPValidator
- func (v *NSNPValidator) Handle(ctx context.Context, req admission.Request) admission.Response
- func (v *NSNPValidator) InjectDecoder(d *admission.Decoder) error
- func (v *NSNPValidator) ValidateIPBlock(ipb *k8snet.IPBlock, fldPath *field.Path) field.ErrorList
- func (v *NSNPValidator) ValidateNSNPPeer(peer *networkv1alpha1.NetworkPolicyPeer, peerPath *field.Path) field.ErrorList
- func (v *NSNPValidator) ValidateNSNPSpec(spec *networkv1alpha1.NamespaceNetworkPolicySpec, fldPath *field.Path) field.ErrorList
- func (v *NSNPValidator) ValidateNetworkPolicyPort(port *k8snet.NetworkPolicyPort, portPath *field.Path) field.ErrorList
- func (v *NSNPValidator) ValidateServiceSelector(serviceSelector *networkv1alpha1.ServiceSelector, fldPath *field.Path) field.ErrorList
- type NSNetworkPolicyController
Constants ¶
View Source
const ( //whether network isolate is enable in namespace NamespaceNPAnnotationKey = "kubesphere.io/network-isolate" NamespaceNPAnnotationEnabled = "enabled" NodeNSNPAnnotationKey = "kubesphere.io/snat-node-ips" AnnotationNPNAME = types.NSNPPrefix + "network-isolate" //TODO: configure it DNSLocalIP = "169.254.25.10" DNSPort = 53 DNSNamespace = "kube-system" DNSServiceName = "kube-dns" DNSServiceCoreDNS = "coredns" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NSNPValidator ¶
func (*NSNPValidator) InjectDecoder ¶
func (v *NSNPValidator) InjectDecoder(d *admission.Decoder) error
func (*NSNPValidator) ValidateIPBlock ¶
ValidateIPBlock validates a cidr and the except fields of an IpBlock NetworkPolicyPeer
func (*NSNPValidator) ValidateNSNPPeer ¶
func (v *NSNPValidator) ValidateNSNPPeer(peer *networkv1alpha1.NetworkPolicyPeer, peerPath *field.Path) field.ErrorList
ValidateNSNPPeer validates a NetworkPolicyPeer
func (*NSNPValidator) ValidateNSNPSpec ¶
func (v *NSNPValidator) ValidateNSNPSpec(spec *networkv1alpha1.NamespaceNetworkPolicySpec, fldPath *field.Path) field.ErrorList
func (*NSNPValidator) ValidateNetworkPolicyPort ¶
func (v *NSNPValidator) ValidateNetworkPolicyPort(port *k8snet.NetworkPolicyPort, portPath *field.Path) field.ErrorList
ValidateNetworkPolicyPort validates a NetworkPolicyPort
func (*NSNPValidator) ValidateServiceSelector ¶
func (v *NSNPValidator) ValidateServiceSelector(serviceSelector *networkv1alpha1.ServiceSelector, fldPath *field.Path) field.ErrorList
type NSNetworkPolicyController ¶
type NSNetworkPolicyController struct {
// contains filtered or unexported fields
}
namespacenpController implements the Controller interface for managing kubesphere network policies and convery them to k8s NetworkPolicies, then syncing them to the provider.
func NewNSNetworkPolicyController ¶
func NewNSNetworkPolicyController( client kubernetes.Interface, ksclient ksnetclient.NetworkV1alpha1Interface, nsnpInformer nspolicy.NamespaceNetworkPolicyInformer, serviceInformer v1.ServiceInformer, nodeInformer v1.NodeInformer, workspaceInformer workspace.WorkspaceInformer, namespaceInformer v1.NamespaceInformer, policyProvider provider.NsNetworkPolicyProvider, options options.NSNPOptions) *NSNetworkPolicyController
NewnamespacenpController returns a controller which manages NSNSP objects.
func (*NSNetworkPolicyController) Run ¶
func (c *NSNetworkPolicyController) Run(threadiness int, reconcilerPeriod string, stopCh <-chan struct{}) error
Run starts the controller.
func (*NSNetworkPolicyController) Start ¶
func (c *NSNetworkPolicyController) Start(stopCh <-chan struct{}) error
Click to show internal directories.
Click to hide internal directories.