k8s

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const EventTypeKey = "event_type"
View Source
const ObjectKindKey = "object_kind"

Variables

View Source
var BackupGVRs = []schema.GroupVersionResource{
	cronjobGVR,
	daemonsetGVR,
	deploymentGVR,
	endpointSliceGVR,
	endpointsGVR,
	jobGVR,
	namespaceGVR,
	nodeGVR,
	podGVR,
	serviceGVR,
	statefulsetGVR,
}
View Source
var WatchedGVRs = []schema.GroupVersionResource{
	configMapGVR,
	cronjobGVR,
	daemonsetGVR,
	deploymentGVR,
	endpointSliceGVR,
	endpointsGVR,
	hpaGVR,
	ingressGVR,
	ingressclassGVR,
	jobGVR,
	kedaScaledObjectGVR,
	mutatingWebhookGVR,
	namespaceGVR,
	networkpolicyGVR,
	nodeGVR,
	persistentvolumeGVR,
	persistentvolumeclaimGVR,
	podGVR,
	podtemplateGVR,
	priorityclassGVR,
	replicasetGVR,
	resourcequotaGVR,
	secretGVR,
	serviceGVR,
	serviceaccountGVR,
	statefulsetGVR,
	validatingWebhookGVR,
	vpaGVR,
}

Functions

func GetAllResources

func GetAllResources(discoveryClient discovery.ServerResourcesInterface) (map[schema.GroupVersionResource]struct{}, error)

Types

type ChangeCollector added in v0.4.6

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

func NewChangeCollector added in v0.4.6

func NewChangeCollector(
	eventCollectionInterval time.Duration,
	backupCollectionInterval time.Duration,
	informerFactory dynamicinformer.DynamicSharedInformerFactory,
	discoveryClient discovery.ServerResourcesInterface,
	logger zerolog.Logger,
	client api.Client,
) *ChangeCollector

func (*ChangeCollector) OnAdd added in v0.4.6

func (c *ChangeCollector) OnAdd(obj interface{})

func (*ChangeCollector) OnDelete added in v0.4.6

func (c *ChangeCollector) OnDelete(obj interface{})

func (*ChangeCollector) OnUpdate added in v0.4.6

func (c *ChangeCollector) OnUpdate(oldObj, newObj interface{})

func (*ChangeCollector) Start added in v0.4.6

func (c *ChangeCollector) Start(ctx context.Context) error

type ControllerFactory

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

func NewControllerFactory

func NewControllerFactory(controllerInitFunc ControllerInitFunc) *ControllerFactory

func (*ControllerFactory) AddControllerForGvk

func (factory *ControllerFactory) AddControllerForGvk(gvk schema.GroupVersionKind) error

AddControllerForGvk adds a controller for GVK with factory's ControllerInitFunc it's up to the client to make sure the gvk is registered with workload cluster

func (*ControllerFactory) DoesControllerExistForGvk

func (factory *ControllerFactory) DoesControllerExistForGvk(gvk schema.GroupVersionKind) bool

type ControllerInitFunc

type ControllerInitFunc func(gvk schema.GroupVersionKind) error

type Metrics

type Metrics struct {
	ChangeEventCounter *prometheus.CounterVec
}

func NewMetrics

func NewMetrics() *Metrics

type TrafficCollector added in v0.4.4

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

func NewTrafficCollector added in v0.4.4

func NewTrafficCollector(
	informerFactory dynamicinformer.DynamicSharedInformerFactory,
	interval time.Duration,
	podSelector labels.Selector,
	serverPort,
	metricsPort int,
	logger zerolog.Logger,
	client api.Client,
) *TrafficCollector

func (*TrafficCollector) Start added in v0.4.4

func (c *TrafficCollector) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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