appmanager

package
v2.16.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Kinds of Resources
	Namespaces     = "namespaces"
	Services       = "services"
	Endpoints      = "endpoints"
	Pod            = "pod"
	Nodes          = "nodes"
	Configmaps     = "configmaps"
	Ingresses      = "ingresses"
	Routes         = "routes"
	Secrets        = "secrets"
	IngressClasses = "ingressclasses"

	NPLPodAnnotation = "nodeportlocal.antrea.io"
	NPLSvcAnnotation = "nodeportlocal.antrea.io/enabled"
	// CNI
	OVN_K8S                    = "ovn-k8s"
	OVNK8sNodeSubnetAnnotation = "k8s.ovn.org/node-subnets"
	OVNK8sNodeIPAnnotation     = "k8s.ovn.org/node-primary-ifaddr"
	// k8s.ovn.org/host-addresses is changed to k8s.ovn.org/host-cidrs in openshift 4.14
	OVNK8sNodeIPAnnotation2 = "k8s.ovn.org/host-addresses"
	OVNK8sNodeIPAnnotation3 = "k8s.ovn.org/host-cidrs"

	CILIUM_K8S                      = "cilium-k8s"
	CiliumK8sNodeSubnetAnnotation12 = "io.cilium.network.ipv4-pod-cidr"
	CiliumK8sNodeSubnetAnnotation13 = "network.cilium.io/ipv4-pod-cidr"
)
View Source
const (
	CCCLAgent = "cccl"
)
View Source
const (
	F5RouterName = "F5 BIG-IP"
)

Variables

View Source
var K8SCoreServices = map[string]bool{
	"kube-dns":                      true,
	"kube-scheduler":                true,
	"kube-controller-manager":       true,
	"kube-apiserver":                true,
	"docker-registry":               true,
	"kubernetes":                    true,
	"registry-console":              true,
	"router":                        true,
	"kubelet":                       true,
	"console":                       true,
	"alertmanager-main":             true,
	"alertmanager-operated":         true,
	"cluster-monitoring-operator":   true,
	"kube-state-metrics":            true,
	"node-exporter":                 true,
	"prometheus-k8s":                true,
	"prometheus-operated":           true,
	"prometheus-operatorwebconsole": true,
	"kube-proxy":                    true,
	"flannel":                       true,
	"etcd":                          true,
	"antrea":                        true,
}
View Source
var OSCPCoreServices = map[string]bool{
	"openshift":                          true,
	"metrics":                            true,
	"api":                                true,
	"check-endpoints":                    true,
	"oauth-openshift":                    true,
	"cco-metrics":                        true,
	"machine-approver":                   true,
	"node-tuning-operator":               true,
	"performance-addon-operator-service": true,
	"cluster-storage-operator-metrics":   true,
	"csi-snapshot-controller-operator-metrics": true,
	"csi-snapshot-webhook":                     true,
	"cluster-version-operator":                 true,
	"downloads":                                true,
	"controller-manager":                       true,
	"dns-default":                              true,
	"image-registry-operator":                  true,
	"router-internal-default":                  true,
	"apiserver":                                true,
	"scheduler":                                true,
	"cluster-autoscaler-operator":              true,
	"cluster-baremetal-operator-service":       true,
	"cluster-baremetal-webhook-service":        true,
	"machine-api-controllers":                  true,
	"machine-api-operator":                     true,
	"machine-api-operator-webhook":             true,
	"machine-config-controller":                true,
	"machine-config-daemon":                    true,
	"certified-operators":                      true,
	"community-operators":                      true,
	"marketplace-operator-metrics":             true,
	"redhat-marketplace":                       true,
	"redhat-operators":                         true,
	"openshift-state-metrics":                  true,
	"telemeter-client":                         true,
	"thanos-querier":                           true,
	"multus-admission-controller":              true,
	"network-metrics-service":                  true,
	"network-check-source":                     true,
	"network-check-target":                     true,
	"catalog-operator-metrics":                 true,
	"olm-operator-metrics":                     true,
	"packageserver-service":                    true,
	"sdn":                                      true,
	"sdn-controller":                           true,
}

Functions

func CheckFlag

func CheckFlag(list []string, searchString string) bool

func RegisterBigIPSchemaTypes

func RegisterBigIPSchemaTypes()

Add new data format to the library

func RemoveUnReferredHealthMonitors

func RemoveUnReferredHealthMonitors(rsCfg *ResourceConfig, fullPoolName string, monitors AnnotationHealthMonitors)

func RemoveUnusedHealthMonitors

func RemoveUnusedHealthMonitors(rsCfg *ResourceConfig)

RemoveUnusedHealthMonitors removes unused health monitors if there are any

Types

type BigIPv4FormatChecker

type BigIPv4FormatChecker struct{}

Big-IP ipv4/ipv6 checkers

func (BigIPv4FormatChecker) IsFormat

func (f BigIPv4FormatChecker) IsFormat(input interface{}) bool

type BigIPv6FormatChecker

type BigIPv6FormatChecker struct{}

func (BigIPv6FormatChecker) IsFormat

func (f BigIPv6FormatChecker) IsFormat(input interface{}) bool

type EventNotifier

type EventNotifier struct {
	// contains filtered or unexported fields
}

func NewEventNotifier

func NewEventNotifier(bfunc NewBroadcasterFunc) *EventNotifier

func (*EventNotifier) CreateNotifierForNamespace

func (en *EventNotifier) CreateNotifierForNamespace(
	namespace string,
	coreIntf corev1.CoreV1Interface,
) *NamespaceEventNotifier

Create a notifier for a namespace, or return the existing one

func (*EventNotifier) DeleteNotifierForNamespace

func (en *EventNotifier) DeleteNotifierForNamespace(namespace string)

func (*EventNotifier) GetNotifierForNamespace

func (en *EventNotifier) GetNotifierForNamespace(
	namespace string,
) *NamespaceEventNotifier

Get the notifier for a namespace

type FwdRuleMap

type FwdRuleMap map[string]bool

key is path regex, data unused. Using a map as go doesn't have a set type.

type HostFwdRuleMap

type HostFwdRuleMap map[string]FwdRuleMap

key is fqdn host name, data is map of paths.

type IngressList added in v2.14.0

type IngressList []*netv1.Ingress

func (IngressList) Len added in v2.14.0

func (slice IngressList) Len() int

func (IngressList) Less added in v2.14.0

func (slice IngressList) Less(i, j int) bool

func (IngressList) Swap added in v2.14.0

func (slice IngressList) Swap(i, j int)

type Manager

type Manager struct {
	DynamicNS bool

	WatchedNS WatchedNamespaces

	AgentCIS cisAgent.CISAgentInterface

	TeemData *teem.TeemsData

	AgentName string
	// contains filtered or unexported fields
}

func NewManager

func NewManager(params *Params) *Manager

Create and return a new app manager that meets the Manager interface

func (*Manager) AddNamespace

func (appMgr *Manager) AddNamespace(
	namespace string,
	cfgMapSelector labels.Selector,
	resyncPeriod time.Duration,
) error

func (*Manager) AddNamespaceLabelInformer

func (appMgr *Manager) AddNamespaceLabelInformer(
	labelSelector labels.Selector,
	resyncPeriod time.Duration,
) error

AddNamespaceLabelInformer spins an informer to watch all namespaces with matching label

func (*Manager) AddNodeInformer added in v2.14.0

func (appMgr *Manager) AddNodeInformer(resyncPeriod time.Duration) error

AddNodeInformer to watch the node udpates

func (*Manager) GetAllWatchedNamespaces

func (appMgr *Manager) GetAllWatchedNamespaces() []string

Get all Namespaces being watched based on Namespaces provided, Namespace Label or all

func (*Manager) GetNamespaceLabelInformer

func (appMgr *Manager) GetNamespaceLabelInformer() cache.SharedIndexInformer

func (*Manager) GetPodsForService

func (appMgr *Manager) GetPodsForService(namespace, serviceName string) ([]*v1.Pod, error)

func (*Manager) GetServicesForPod

func (appMgr *Manager) GetServicesForPod(pod *v1.Pod) []*v1.Service

func (*Manager) GetWatchedNamespaces

func (appMgr *Manager) GetWatchedNamespaces() []string

func (*Manager) GetWatchedNamespacesLockless

func (appMgr *Manager) GetWatchedNamespacesLockless() []string

func (*Manager) HandleTranslateAddress

func (appMgr *Manager) HandleTranslateAddress(sKey serviceQueueKey, stats *vsSyncStats)

HandleTranslateAddress - Sets Address Translate flag for Virtual Server

func (*Manager) IsNodePort

func (appMgr *Manager) IsNodePort() bool

func (*Manager) ProcessNodeUpdate

func (appMgr *Manager) ProcessNodeUpdate(
	obj interface{},
)

Check for a change in Node state

func (*Manager) Run

func (appMgr *Manager) Run(stopCh <-chan struct{})

func (*Manager) UseNodeInternal

func (appMgr *Manager) UseNodeInternal() bool

type NPLAnnoations

type NPLAnnoations []NPLAnnotation

List of NPL annotations

type NPLAnnotation

type NPLAnnotation struct {
	PodPort  int32  `json:"podPort"`
	NodeIP   string `json:"nodeIP"`
	NodePort int32  `json:"nodePort"`
}

NPL information from pod annotation

type NamespaceEventNotifier

type NamespaceEventNotifier struct {
	// contains filtered or unexported fields
}

func (*NamespaceEventNotifier) RecordEvent

func (nen *NamespaceEventNotifier) RecordEvent(
	obj runtime.Object,
	eventType,
	reason,
	message string,
)

type NamespaceEventNotifierMap

type NamespaceEventNotifierMap map[string]*NamespaceEventNotifier

type NewBroadcasterFunc

type NewBroadcasterFunc func() record.EventBroadcaster

type Node

type Node struct {
	Name string
	Addr string
}

type NodeList

type NodeList []v1.Node

func (NodeList) Len

func (nodes NodeList) Len() int

sort nodes by Name

func (NodeList) Less

func (nodes NodeList) Less(i, j int) bool

func (NodeList) Swap

func (nodes NodeList) Swap(i, j int)

type Params

type Params struct {
	KubeClient        kubernetes.Interface
	RouteClientV1     routeclient.RouteV1Interface
	UseNodeInternal   bool
	IsNodePort        bool
	RouteConfig       RouteConfig
	ResolveIngress    string
	DefaultIngIP      string
	VsSnatPoolName    string
	NodeLabelSelector string
	UseSecrets        bool
	SchemaLocal       string
	EventChan         chan interface{}
	ConfigWriter      writer.Writer

	ManageConfigMaps       bool
	ManageIngress          bool
	ManageIngressClassOnly bool
	HubMode                bool
	IngressClass           string
	Agent                  string
	SchemaLocalPath        string
	TrustedCertsCfgmap     string
	// Data group path
	DgPath             string
	AgRspChan          chan interface{}
	ProcessAgentLabels func(map[string]string, string, string) bool
	UserAgent          string
	DefaultRouteDomain int
	PoolMemberType     string
	//vxlan
	VXLANName           string
	VXLANMode           string
	CiliumTunnelName    string
	StaticRoutingMode   bool
	OrchestrationCNI    string
	StaticRouteNodeCIDR string
	// contains filtered or unexported fields
}

Struct to allow NewManager to receive all or only specific parameters.

type PodList added in v2.16.0

type PodList []*v1.Pod

func (PodList) Len added in v2.16.0

func (pods PodList) Len() int

sort pods by Name

func (PodList) Less added in v2.16.0

func (pods PodList) Less(i, j int) bool

func (PodList) Swap added in v2.16.0

func (pods PodList) Swap(i, j int)

type ProcessedHostPath

type ProcessedHostPath struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Store of processed host-Path map

type ResourceMap

type ResourceMap map[int32][]*ResourceConfig

type RouteConfig

type RouteConfig struct {
	RouteVSAddr string
	RouteLabel  string
	HttpVs      string
	HttpsVs     string
	ClientSSL   string
	ServerSSL   string
}

Configuration options for Routes in OpenShift

type RouteList

type RouteList []*routeapi.Route

func (RouteList) Len

func (slice RouteList) Len() int

func (RouteList) Less

func (slice RouteList) Less(i, j int) bool

func (RouteList) Swap

func (slice RouteList) Swap(i, j int)

type RoutesMap

type RoutesMap map[string][]string

RoutesMap consists of List of route names indexed by namespace

type ServiceFwdRuleMap

type ServiceFwdRuleMap map[serviceQueueKey]HostFwdRuleMap

key is namespace/serviceName, data is map of host to paths.

func NewServiceFwdRuleMap

func NewServiceFwdRuleMap() ServiceFwdRuleMap

func (ServiceFwdRuleMap) AddEntry

func (sfrm ServiceFwdRuleMap) AddEntry(ns, svc, host, path string)

func (ServiceFwdRuleMap) AddToDataGroup

func (sfrm ServiceFwdRuleMap) AddToDataGroup(dgMap DataGroupNamespaceMap, partition string)

type SvcEndPointsCache

type SvcEndPointsCache struct {
	// contains filtered or unexported fields
}

type WatchedNamespaces

type WatchedNamespaces struct {
	Namespaces     []string
	NamespaceLabel string
}

Watched Namespaces for global availability.

Jump to

Keyboard shortcuts

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