npm

package module
v0.0.0-...-2427888 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2020 License: MIT Imports: 23 Imported by: 1

Documentation

Overview

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

Copyright 2018 Microsoft. All rights reserved. MIT License

Copyright 2018 Microsoft. All rights reserved. MIT License

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOperatorAndLabel

func GetOperatorAndLabel(label string) (string, string)

GetOperatorAndLabel returns the operator associated with the label and the label without operator.

func GetOperatorsAndLabels

func GetOperatorsAndLabels(labelsWithOps []string) ([]string, []string)

GetOperatorsAndLabels returns the operators along with the associated labels.

func HashSelector

func HashSelector(selector *metav1.LabelSelector) string

HashSelector returns the hash value of the selector.

func ParseLabel

func ParseLabel(label string) (string, bool)

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 NetworkPolicyManager

type NetworkPolicyManager struct {
	sync.Mutex

	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) AddNamespace

func (npMgr *NetworkPolicyManager) AddNamespace(nsObj *corev1.Namespace) error

AddNamespace handles adding namespace to ipset.

func (*NetworkPolicyManager) AddNetworkPolicy

func (npMgr *NetworkPolicyManager) AddNetworkPolicy(npObj *networkingv1.NetworkPolicy) error

AddNetworkPolicy handles adding network policy to iptables.

func (*NetworkPolicyManager) AddPod

func (npMgr *NetworkPolicyManager) AddPod(podObj *corev1.Pod) error

AddPod handles adding pod ip to its label's ipset.

func (*NetworkPolicyManager) DeleteNamespace

func (npMgr *NetworkPolicyManager) DeleteNamespace(nsObj *corev1.Namespace) error

DeleteNamespace handles deleting namespace from ipset.

func (*NetworkPolicyManager) DeleteNetworkPolicy

func (npMgr *NetworkPolicyManager) DeleteNetworkPolicy(npObj *networkingv1.NetworkPolicy) error

DeleteNetworkPolicy handles deleting network policy from iptables.

func (*NetworkPolicyManager) DeletePod

func (npMgr *NetworkPolicyManager) DeletePod(podObj *corev1.Pod) error

DeletePod handles deleting pod from its label's ipset.

func (*NetworkPolicyManager) GetClusterState

func (npMgr *NetworkPolicyManager) GetClusterState() telemetry.ClusterState

GetClusterState returns current cluster state.

func (*NetworkPolicyManager) InitAllNsList

func (npMgr *NetworkPolicyManager) InitAllNsList() error

InitAllNsList syncs all-namespace ipset list.

func (*NetworkPolicyManager) SendAiMetrics

func (npMgr *NetworkPolicyManager) SendAiMetrics()

SendAiMetrics :- send NPM 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.

func (*NetworkPolicyManager) UninitAllNsList

func (npMgr *NetworkPolicyManager) UninitAllNsList() error

UninitAllNsList cleans all-namespace ipset list.

func (*NetworkPolicyManager) UpdateNamespace

func (npMgr *NetworkPolicyManager) UpdateNamespace(oldNsObj *corev1.Namespace, newNsObj *corev1.Namespace) error

UpdateNamespace handles updating namespace in ipset.

func (*NetworkPolicyManager) UpdateNetworkPolicy

func (npMgr *NetworkPolicyManager) UpdateNetworkPolicy(oldNpObj *networkingv1.NetworkPolicy, newNpObj *networkingv1.NetworkPolicy) error

UpdateNetworkPolicy handles updateing network policy in iptables.

func (*NetworkPolicyManager) UpdatePod

func (npMgr *NetworkPolicyManager) UpdatePod(oldPodObj, newPodObj *corev1.Pod) error

UpdatePod handles updating pod ip in its label's ipset.

type ReqHeap

An ReqHeap is a min-heap of labelSelectorRequirements.

func (ReqHeap) Len

func (h ReqHeap) Len() int

func (ReqHeap) Less

func (h ReqHeap) Less(i, j int) bool

func (*ReqHeap) Pop

func (h *ReqHeap) Pop() interface{}

func (*ReqHeap) Push

func (h *ReqHeap) Push(x interface{})

func (ReqHeap) Swap

func (h ReqHeap) Swap(i, j int)

Directories

Path Synopsis
Part of this file is modified from iptables package from Kuberenetes.
Part of this file is modified from iptables package from Kuberenetes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL