kubernetes

package
v0.22.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

+kubebuilder:validation:Optional

Index

Constants

This section is empty.

Variables

View Source
var (
	// ConfigKey is the configuration key for Kubernetes Discovery.
	ConfigKey = common.DiscoveryConfigKey + ".kubernetes"
	// FxTagBase is the tag's base used to identify the Kubernetes Control Points Tracker.
	FxTagBase = "kubernetes_control_points"
	// FxTag is the tag used to identify the Kubernetes Control Points Tracker.
	FxTag = config.NameTag(FxTagBase)
)

Functions

func InvokeServiceDiscovery added in v0.19.0

func InvokeServiceDiscovery(in FxInSvc) error

InvokeServiceDiscovery creates a Kubernetes service discovery.

func Module added in v0.19.0

func Module() fx.Option

Module returns an fx.Option that provides the Kubernetes discovery module.

Types

type AutoScaler added in v0.19.0

type AutoScaler interface {
	Scale(ControlPoint, int32)
}

AutoScaler provides an interface to invoke auto-scale.

type ControlPoint added in v0.19.0

type ControlPoint struct {
	Group     string
	Version   string
	Kind      string
	Namespace string
	Name      string
}

A ControlPoint is identified by Group, Version, Kind, Namespace and Name.

func ControlPointFromSelector added in v0.19.0

func ControlPointFromSelector(k8sObjectSelector *policylangv1.KubernetesObjectSelector) (ControlPoint, error)

ControlPointFromSelector converts a policylangv1.KubernetesObjectSelector to a ControlPoint.

func (*ControlPoint) ToProto added in v0.19.0

ToProto converts a ControlPoint to a KubernetesControlPoint.

type ControlPointCache added in v0.19.0

type ControlPointCache interface {
	Keys() []ControlPoint
	AddKeyNotifier(notifiers.KeyNotifier) error
	RemoveKeyNotifier(notifiers.KeyNotifier) error
}

ControlPointCache is the interface for Reading or Watching Kubernetes Control Points.

func ProvideControlPointCache added in v0.19.0

func ProvideControlPointCache(in FxInK8sScale) (ControlPointCache, error)

ProvideControlPointCache provides Kubernetes AutoScaler and starts Kubernetes control point discovery if enabled.

type ControlPointStore added in v0.19.0

type ControlPointStore interface {
	Add(cp ControlPoint)
	Update(cp ControlPoint)
	Delete(cp ControlPoint)
}

ControlPointStore is the interface for Storing Kubernetes Control Points.

type FxInK8sScale added in v0.19.0

type FxInK8sScale struct {
	fx.In
	Unmarshaller     config.Unmarshaller
	Lifecycle        fx.Lifecycle
	StatusRegistry   status.Registry
	KubernetesClient k8s.K8sClient `optional:"true"`
	Election         *election.Election
	Trackers         notifiers.Trackers `name:"kubernetes_control_points"`
}

FxInK8sScale is the input for the ProvideKuberetesControlPointsCache function.

type FxInSvc added in v0.19.0

type FxInSvc struct {
	fx.In
	Unmarshaller     config.Unmarshaller
	Lifecycle        fx.Lifecycle
	StatusRegistry   status.Registry
	KubernetesClient k8s.K8sClient
	EntityTrackers   *entitycache.EntityTrackers
}

FxInSvc describes parameters passed to k8s discovery constructor.

type KubernetesDiscoveryConfig

type KubernetesDiscoveryConfig struct {
	// NodeName is the name of the k8s node the agent should be monitoring
	NodeName         string `json:"node_name"`
	PodName          string `json:"pod_name"`
	DiscoveryEnabled bool   `json:"discovery_enabled" default:"true"`
	AutoscaleEnabled bool   `json:"autoscale_enabled" default:"true"`
}

KubernetesDiscoveryConfig for Kubernetes service discovery. swagger:model +kubebuilder:object:generate=true

func (*KubernetesDiscoveryConfig) DeepCopy added in v0.1.2

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesDiscoveryConfig.

func (*KubernetesDiscoveryConfig) DeepCopyInto added in v0.1.2

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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