k8s

package
v1.5.0-alpha.12 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEventHandlerFuncs

func GetEventHandlerFuncs(shouldObserve observeFilter, eventTypes EventTypes, msgBroker *messaging.Broker) cache.ResourceEventHandlerFuncs

GetEventHandlerFuncs returns the ResourceEventHandlerFuncs object used to receive events when a k8s object is added/updated/deleted.

Types

type Controller

type Controller interface {

	// IsMonitoredNamespace returns whether a namespace with the given name is being monitored
	// by the mesh
	IsMonitoredNamespace(namespace string) bool

	// ListMonitoredNamespaces returns the namespaces monitored by the mesh
	ListMonitoredNamespaces() ([]string, error)

	// GetNamespace returns k8s namespace present in cache
	GetNamespace(namespace string) *corev1.Namespace

	IsMonitoredPod(pod string, namespace string) bool

	// ListAllPods returns all pods
	ListAllPods() []*corev1.Pod

	// ListMonitoredPods returns the pods monitored by the mesh
	ListMonitoredPods() []*corev1.Pod

	// ListSidecarPods returns the gateway pods as sidecar.
	ListSidecarPods() []*corev1.Pod
}

Controller is the controller interface for K8s services

func NewKubernetesController

func NewKubernetesController(informerCollection *informers.InformerCollection, msgBroker *messaging.Broker, meshExcludeNamespaces []string) Controller

NewKubernetesController returns a new kubernetes.Controller which means to provide access to locally-cached k8s resources

type EventTypes

type EventTypes struct {
	Add    kind.Kind
	Update kind.Kind
	Delete kind.Kind
}

EventTypes is a struct helping pass the correct types to GetEventHandlerFuncs()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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