Documentation ¶
Overview ¶
Copyright 2018 Microsoft. All rights reserved. MIT License
Copyright 2018 Microsoft. All rights reserved. MIT License
Package npm Copyright 2018 Microsoft. All rights reserved. MIT License
Copyright 2018 Microsoft. All rights reserved. MIT License
Copyright 2018 Microsoft. All rights reserved. MIT License
Copyright 2018 Microsoft. All rights reserved. MIT License
Index ¶
- func GetAIMetadata() string
- func GetOperatorAndLabel(label string) (string, string)
- func GetOperatorsAndLabels(labelsWithOps []string) ([]string, []string)
- func HashSelector(selector *metav1.LabelSelector) string
- func NewNameSpaceController(nameSpaceInformer coreinformer.NamespaceInformer, ...) *nameSpaceController
- func NewNetworkPolicyController(npInformer networkinginformers.NetworkPolicyInformer, ...) *networkPolicyController
- func NewPodController(podInformer coreinformer.PodInformer, clientset kubernetes.Interface, ...) *podController
- func ParseLabel(label string) (string, bool)
- type IsSafeCleanUpAzureNpmChain
- type NamedPortOperation
- type Namespace
- type NetworkPolicyManager
- type NpmPod
- type ReqHeap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOperatorAndLabel ¶ added in v1.0.27
GetOperatorAndLabel returns the operator associated with the label and the label without operator.
func GetOperatorsAndLabels ¶ added in v1.0.27
GetOperatorsAndLabels returns the operators along with the associated labels.
func HashSelector ¶ added in v1.0.27
func HashSelector(selector *metav1.LabelSelector) string
HashSelector returns the hash value of the selector.
func NewNameSpaceController ¶ added in v1.2.9
func NewNameSpaceController(nameSpaceInformer coreinformer.NamespaceInformer, clientset kubernetes.Interface, npMgr *NetworkPolicyManager) *nameSpaceController
func NewNetworkPolicyController ¶ added in v1.2.9
func NewNetworkPolicyController(npInformer networkinginformers.NetworkPolicyInformer, clientset kubernetes.Interface, npMgr *NetworkPolicyManager) *networkPolicyController
func NewPodController ¶ added in v1.2.9
func NewPodController(podInformer coreinformer.PodInformer, clientset kubernetes.Interface, npMgr *NetworkPolicyManager) *podController
func ParseLabel ¶ added in v1.0.27
ParseLabel takes a Azure-NPM processed label then returns if it's referring to complement set, and if so, returns the original set as well.
Types ¶
type IsSafeCleanUpAzureNpmChain ¶ added in v1.2.9
type IsSafeCleanUpAzureNpmChain bool
IsSafeCleanUpAzureNpmChain is used to indicate whether default Azure NPM chain can be safely deleted or not.
const (
SafeToCleanUpAzureNpmChain IsSafeCleanUpAzureNpmChain = true
)
type NamedPortOperation ¶ added in v1.2.9
type NamedPortOperation string
NamedPortOperation decides opeartion (e.g., delete or add) for named port ipset in manageNamedPortIpsets
const ( DeleteNamedPortIpsets NamedPortOperation = "del" AddNamedPortIpsets NamedPortOperation = "add" )
type NetworkPolicyManager ¶
type NetworkPolicyManager struct { sync.Mutex NodeName string NsMap map[string]*Namespace // Key is ns-<nsname> PodMap map[string]*NpmPod // Key is <nsname>/<podname> RawNpMap map[string]*networkingv1.NetworkPolicy // Key is <nsname>/<policyname> ProcessedNpMap map[string]*networkingv1.NetworkPolicy // Key is <nsname>/<podSelectorHash> TelemetryEnabled bool // contains filtered or unexported fields }
NetworkPolicyManager contains informers for pod, namespace and networkpolicy.
func NewNetworkPolicyManager ¶
func NewNetworkPolicyManager(clientset *kubernetes.Clientset, informerFactory informers.SharedInformerFactory, npmVersion string) *NetworkPolicyManager
NewNetworkPolicyManager creates a NetworkPolicyManager
func (*NetworkPolicyManager) GetAppVersion ¶
func (npMgr *NetworkPolicyManager) GetAppVersion() string
GetAppVersion returns network policy manager app version
func (*NetworkPolicyManager) GetClusterState ¶ added in v1.0.9
func (npMgr *NetworkPolicyManager) GetClusterState() telemetry.ClusterState
GetClusterState returns current cluster state.
func (*NetworkPolicyManager) SendClusterMetrics ¶ added in v1.1.8
func (npMgr *NetworkPolicyManager) SendClusterMetrics()
SendClusterMetrics :- send NPM cluster metrics using AppInsights
func (*NetworkPolicyManager) Start ¶
func (npMgr *NetworkPolicyManager) Start(stopCh <-chan struct{}) error
Start starts shared informers and waits for the shared informer cache to sync.
type ReqHeap ¶ added in v1.0.27
type ReqHeap []metav1.LabelSelectorRequirement
An ReqHeap is a min-heap of labelSelectorRequirements.