appmanager

package
v0.0.0-...-a9a91c4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (

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

	NPLPodAnnotation = "nodeportlocal.antrea.io"
	NPLSvcAnnotation = "nodeportlocal.antrea.io/enabled"
)
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,
}

Functions

func NewBroadcasterWrapper

func NewBroadcasterWrapper() record.EventBroadcaster

func RegisterBigIPSchemaTypes

func RegisterBigIPSchemaTypes()

Add new data format to the library

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 Manager

type Manager struct {
	DynamicNS bool

	WatchedNS WatchedNamespaces

	AgentCIS cisAgent.CISAgentInterface

	K8sVersion string
	TeemData   *teem.TeemsData
	// 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) 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.PodList

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

func (appMgr *Manager) IsNodePort() bool

func (*Manager) ProcessNodeUpdate

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

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 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{}

	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
	// contains filtered or unexported fields
}

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

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)

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