ciliumendpointslice

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// CESMaxCEPsInCES is the maximum number of cilium endpoints allowed in single
	// a CiliumEndpointSlice resource.
	CESMaxCEPsInCES = "ces-max-ciliumendpoints-per-ces"

	// CESSlicingMode instructs how CEPs are grouped in a CES.
	CESSlicingMode = "ces-slice-mode"

	// CESWriteQPSLimit is the rate limit per second for the CES work queue to
	// process  CES events that result in CES write (Create, Update, Delete)
	// requests to the kube-apiserver.
	CESWriteQPSLimit = "ces-write-qps-limit"

	// CESWriteQPSBurst is the burst rate per second used with CESWriteQPSLimit
	// for the CES work queue to process CES events that result in CES write
	// (Create, Update, Delete) requests to the kube-apiserver.
	CESWriteQPSBurst = "ces-write-qps-burst"
)
View Source
const (

	// default qps limit value for workqueues, this only for retries.
	CESControllerWorkQueueQPSLimit = 10
	// default burst limit value for workqueues.
	CESControllerWorkQueueBurstLimit = 100
	// Default CES Synctime, multiple consecutive syncs with k8s-apiserver are
	// batched and synced together after a short delay.
	DefaultCESSyncTime = 500 * time.Millisecond

	CESWriteQPSLimitMax = 50
	CESWriteQPSBurstMax = 100
)
View Source
const (
	// LabelOutcome indicates whether the outcome of the operation was successful or not
	LabelOutcome = "outcome"

	// LabelOpcode indicates the kind of CES metric, could be CEP insert or remove
	LabelOpcode = "opcode"

	// LabelValueOutcomeSuccess is used as a successful outcome of an operation
	LabelValueOutcomeSuccess = "success"

	// LabelValueOutcomeFail is used as an unsuccessful outcome of an operation
	LabelValueOutcomeFail = "fail"

	// LabelValueCEPInsert is used to indicate the number of CEPs inserted in a CES
	LabelValueCEPInsert = "cepinserted"

	// LabelValueCEPRemove is used to indicate the number of CEPs removed from a CES
	LabelValueCEPRemove = "cepremoved"
)

Variables

View Source
var Cell = cell.Module(
	"k8s-ces-controller",
	"Cilium Endpoint Slice Controller",
	cell.Config(defaultConfig),
	cell.Invoke(registerController),
	cell.Metric(NewMetrics),
)

Cell is a cell that implements a Cilium Endpoint Slice Controller. The controller subscribes to cilium endpoint and cilium endpoint slices events and reconciles the state of the cilium endpoint slices in the cluster.

Functions

This section is empty.

Types

type CEPName

type CEPName resource.Key

func GetCEPNameFromCCEP

func GetCEPNameFromCCEP(cep *capi_v2a1.CoreCiliumEndpoint, namespace string) CEPName

func NewCEPName added in v1.15.0

func NewCEPName(name, ns string) CEPName

type CESData added in v1.15.0

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

CESData contains all CES data except endpoints. CES is reconicled to have endpoints equal to CEPs mapped to it and other fields set from the CESData.

type CESName

type CESName resource.Key

func NewCESName added in v1.15.0

func NewCESName(name string) CESName

type CESToCEPMapping

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

CESToCEPMapping is used to map Cilium Endpoints to CiliumEndpointSlices and retrieving all the Cilium Endpoints mapped to the given CiliumEndpointSlice. This map is protected by lock for consistent and concurrent access.

type Config added in v1.15.0

type Config struct {
	CESMaxCEPsInCES  int     `mapstructure:"ces-max-ciliumendpoints-per-ces"`
	CESSlicingMode   string  `mapstructure:"ces-slice-mode"`
	CESWriteQPSLimit float64 `mapstructure:"ces-write-qps-limit"`
	CESWriteQPSBurst int     `mapstructure:"ces-write-qps-burst"`
}

func (Config) Flags added in v1.15.0

func (def Config) Flags(flags *pflag.FlagSet)

type Controller added in v1.15.0

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

func (*Controller) Start added in v1.15.0

func (c *Controller) Start(ctx cell.HookContext) error

start the worker thread, reconciles the modified CESs with api-server

func (*Controller) Stop added in v1.15.0

func (c *Controller) Stop(ctx cell.HookContext) error

type Metrics added in v1.15.0

type Metrics struct {
	// CiliumEndpointSliceDensity indicates the number of CEPs batched in a CES and it used to
	// collect the number of CEPs in CES at various buckets.
	CiliumEndpointSliceDensity metric.Histogram

	// CiliumEndpointsChangeCount indicates the total number of CEPs changed for every CES request sent to k8s-apiserver.
	// This metric is used to collect number of CEP changes happening at various buckets.
	CiliumEndpointsChangeCount metric.Vec[metric.Observer]

	// CiliumEndpointSliceSyncTotal indicates the total number of completed CES syncs with k8s-apiserver by success/fail outcome.
	CiliumEndpointSliceSyncTotal metric.Vec[metric.Counter]

	// CiliumEndpointSliceSyncErrors used to track the total number of errors occurred during syncing CES with k8s-apiserver.
	// This metric is going to be deprecated in Cilium 1.14 and removed in 1.15.
	// It is replaced by CiliumEndpointSliceSyncTotal metric.
	CiliumEndpointSliceSyncErrors metric.Counter

	// CiliumEndpointSliceQueueDelay measures the time spent by CES's in the workqueue. This measures time difference between
	// CES insert in the workqueue and removal from workqueue.
	CiliumEndpointSliceQueueDelay metric.Histogram
}

func NewMetrics added in v1.15.0

func NewMetrics() *Metrics

type SharedConfig added in v1.15.0

type SharedConfig struct {
	// EnableCiliumEndpointSlice enables the cilium endpoint slicing feature and the CES Controller.
	EnableCiliumEndpointSlice bool
}

SharedConfig contains the configuration that is shared between this module and others. It is a temporary solution meant to avoid polluting this module with a direct dependency on global operator and daemon configurations.

Jump to

Keyboard shortcuts

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