Documentation ¶
Index ¶
Constants ¶
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" // CESEnableDynamicRateLimit is used to ignore static QPS Limit and Burst // and use dynamic limit, burst and nodes instead. CESEnableDynamicRateLimit = "ces-enable-dynamic-rate-limit" // CESDynamicRateLimitNodes is used to specify the list of nodes used for the // dynamic rate limit steps. CESDynamicRateLimitNodes = "ces-dynamic-rate-limit-nodes" // CESDynamicRateLimitQPSLimit is used to specify the list of qps limits for the // dynamic rate limit steps. CESDynamicRateLimitQPSLimit = "ces-dynamic-rate-limit-qps-limit" // CESDynamicRateLimitQPSBurst is used to specify the list of qps bursts for the // dynamic rate limit steps. CESDynamicRateLimitQPSBurst = "ces-dynamic-rate-limit-qps-burst" // CESRateLimits can be used to configure a custom, stepped dynamic rate limit based on cluster size. CESRateLimits = "ces-rate-limits" )
const ( // 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 )
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 ¶
var Cell = cell.Module( "k8s-ces-controller", "Cilium Endpoint Slice Controller", cell.Config(defaultConfig), cell.Invoke(registerController), metrics.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 ¶
func GetCEPNameFromCCEP ¶
func GetCEPNameFromCCEP(cep *capi_v2a1.CoreCiliumEndpoint, namespace string) CEPName
func NewCEPName ¶ added in v1.15.0
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 ¶
func NewCESName ¶ added in v1.15.0
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" exhaustruct:"optional"` CESWriteQPSBurst int `mapstructure:"ces-write-qps-burst" exhaustruct:"optional"` CESEnableDynamicRateLimit bool `mapstructure:"ces-enable-dynamic-rate-limit" exhaustruct:"optional"` CESDynamicRateLimitNodes []string `mapstructure:"ces-dynamic-rate-limit-nodes" exhaustruct:"optional"` CESDynamicRateLimitQPSLimit []string `mapstructure:"ces-dynamic-rate-limit-qps-limit" exhaustruct:"optional"` CESDynamicRateLimitQPSBurst []string `mapstructure:"ces-dynamic-rate-limit-qps-burst" exhaustruct:"optional"` CESDynamicRateLimitConfig string `mapstructure:"ces-rate-limits"` }
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] // 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 { bool }EnableCiliumEndpointSlice
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.