npm

package
v1.4.11 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 36 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 FlattenNameSpaceSelector added in v1.4.5

func FlattenNameSpaceSelector(nsSelector *metav1.LabelSelector) []metav1.LabelSelector

flattenNameSpaceSelector will help flatten multiple NameSpace selector match Expressions values into multiple label selectors helping with the OR condition.

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,
	ipsMgr *ipsm.IpsetManager, npmNamespaceCache *npmNamespaceCache) *nameSpaceController

func NewNetworkPolicyController added in v1.2.9

func NewNetworkPolicyController(npInformer networkinginformers.NetworkPolicyInformer,
	clientset kubernetes.Interface, ipsMgr *ipsm.IpsetManager) *networkPolicyController

func NewPodController added in v1.2.9

func NewPodController(podInformer coreinformer.PodInformer, clientset kubernetes.Interface,
	ipsMgr *ipsm.IpsetManager, npmNamespaceCache *npmNamespaceCache) *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.

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

type Namespace added in v1.2.8

type Namespace struct {
	LabelsMap map[string]string // NameSpace labels
	// contains filtered or unexported fields
}

type NetworkPolicyManager

type NetworkPolicyManager struct {
	NodeName string

	TelemetryEnabled bool
	// contains filtered or unexported fields
}

NetworkPolicyManager contains informers for pod, namespace and networkpolicy.

func NewNetworkPolicyManager

func NewNetworkPolicyManager(clientset kubernetes.Interface, informerFactory informers.SharedInformerFactory,
	exec utilexec.Interface, npmVersion string, k8sServerVersion *version.Info) *NetworkPolicyManager

NewNetworkPolicyManager creates a NetworkPolicyManager

func (*NetworkPolicyManager) Encode added in v1.4.11

func (npMgr *NetworkPolicyManager) Encode(writer io.Writer) error

Encode returns all information of pod, namespace, ipsm map information. TODO(jungukcho): While this approach is beneficial to hold separate lock instead of global lock, it has strict ordering limitation between encoding and decoding. Will find flexible way by maintaining performance benefit.

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 TODO(jungukcho): need to move codes into metrics packages

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 NetworkPolicyManagerEncoder added in v1.4.11

type NetworkPolicyManagerEncoder interface {
	Encode(writer io.Writer) error
}

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
debugTools
pb
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