npm

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 33 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAIMetadata

func GetAIMetadata() string

GetAIMetadata returns ai metadata number

func GetOperatorAndLabel added in v1.0.27

func GetOperatorAndLabel(label string) (string, string)

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

func GetOperatorsAndLabels added in v1.0.27

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

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

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 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 LabelAppendOperation added in v1.3.0

type LabelAppendOperation bool
const (
	ClearExistingLabels    LabelAppendOperation = true
	AppendToExistingLabels LabelAppendOperation = false
)

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 Namespace added in v1.2.8

type Namespace struct {
	LabelsMap map[string]string // NameSpace labels
	SetMap    map[string]string
	IpsMgr    *ipsm.IpsetManager
	// contains filtered or unexported fields
}

type NetworkPolicyManager

type NetworkPolicyManager struct {
	sync.Mutex

	Exec utilexec.Interface

	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, exec utilexec.Interface, 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 NpmPod added in v1.2.8

type NpmPod struct {
	Name           string
	Namespace      string
	PodIP          string
	Labels         map[string]string
	ContainerPorts []corev1.ContainerPort
	Phase          corev1.PodPhase
}

type ReqHeap added in v1.0.27

An ReqHeap is a min-heap of labelSelectorRequirements.

func (ReqHeap) Len added in v1.0.27

func (h ReqHeap) Len() int

func (ReqHeap) Less added in v1.0.27

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

func (*ReqHeap) Pop added in v1.0.27

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

func (*ReqHeap) Push added in v1.0.27

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

func (ReqHeap) Swap added in v1.0.27

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

Directories

Path Synopsis
http
api
Package ipsm focus on ip set operation Copyright 2018 Microsoft.
Package ipsm focus on ip set operation Copyright 2018 Microsoft.

Jump to

Keyboard shortcuts

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