Documentation
¶
Index ¶
- Constants
- Variables
- func GetPodEndpointNetworking(pod *slim_corev1.Pod) (*cilium_v2.EndpointNetworking, error)
- type CEPData
- type CEPName
- type CESCache
- type CESCacher
- type CESData
- type CESKey
- type CESName
- type CESToCEPMapping
- type CID
- type Config
- type Controller
- type DefaultController
- type EncryptionKey
- type Labels
- type Manager
- type Metrics
- type NodeData
- type NodeName
- type SecIDs
- type SharedConfig
- type SlimController
Constants ¶
const ( // CESMaxCEPsInCES is the maximum number of cilium endpoints allowed in single // a CiliumEndpointSlice resource. CESMaxCEPsInCES = "ces-max-ciliumendpoints-per-ces" // CESRateLimits can be used to configure a custom, stepped dynamic rate limit based on cluster size. CESRateLimits = "ces-rate-limits" // CESControllerMode sets the CES controller operation mode. CESControllerMode = "ces-controller-mode" )
const ( // LabelOutcome indicates whether the outcome of the operation was successful or not LabelOutcome = "outcome" // LabelFailureType indicates which failure type occurred when "outcome" is "fail" LabelFailureType = "failure_type" // LabelOpcode indicates the kind of CES metric, could be CEP insert or remove LabelOpcode = "opcode" // LabelQueue denotes which queue was used LabelQueue = "queue" // LabelValueOutcomeSuccess is used as a successful outcome of an operation LabelValueOutcomeSuccess = "success" // LabelValueOutcomeFail is used as an unsuccessful outcome of an operation LabelValueOutcomeFail = "fail" // LabelFailureTypeTransient is used to indicate a transient failure, which is retried LabelFailureTypeTransient = "transient" // LabelFailureTypeFatal is used to indicate a fatal failure, when all retries have been exhausted LabelFailureTypeFatal = "fatal" // 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" //LabelQueueFast is used when the fast queue was used LabelQueueFast = "fast" //LabelQueueStandard is used when the standard queue was used LabelQueueStandard = "standard" )
const ( // Default CES Synctime, multiple consecutive syncs with k8s-apiserver are // batched and synced together after a short delay. DefaultCESSyncTime = 500 * time.Millisecond )
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 ¶
func GetPodEndpointNetworking ¶ added in v1.20.0
func GetPodEndpointNetworking(pod *slim_corev1.Pod) (*cilium_v2.EndpointNetworking, error)
Constructs an EndpointNetworking object for a given pod.
Types ¶
type CEPData ¶ added in v1.20.0
type CEPData struct {
// contains filtered or unexported fields
}
CEPData contains the CES, node and labels associated with the corecep.
type CEPName ¶
func GetCEPNameFromCCEP ¶
func GetCEPNameFromCCEP(cep *capi_v2a1.CoreCiliumEndpoint, namespace string) CEPName
func GetCEPNameFromPod ¶ added in v1.20.0
func GetCEPNameFromPod(pod *slim_corev1.Pod) CEPName
func NewCEPName ¶ added in v1.15.0
type CESCache ¶ added in v1.20.0
type CESCache struct {
// contains filtered or unexported fields
}
CESCache stores local CES goal state when the CES controller is running in slim mode. The CESCache itself is not protected by a lock; the caller should hold a lock in order to safely perform multi-step operations on the cache.
type CESCacher ¶ added in v1.20.0
type CESCacher interface {
// contains filtered or unexported methods
}
type CESData ¶ added in v1.15.0
type CESData struct {
// contains filtered or unexported fields
}
CESData contains all CES data, including endpoints. CES is reconciled to have endpoints equal to CEPs mapped to it and other fields set from the CESData.
func NewCESData ¶ added in v1.20.0
Initializes CESData with given namespace
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 Controller ¶ added in v1.15.0
type DefaultController ¶ added in v1.20.0
type DefaultController struct {
*Controller
// contains filtered or unexported fields
}
DefaultController is the CES controller running in default mode, creating CES from CEPs.
func (*DefaultController) Start ¶ added in v1.20.0
func (c *DefaultController) Start(ctx cell.HookContext) error
start the worker thread, reconciles the modified CESs with api-server
func (*DefaultController) Stop ¶ added in v1.20.0
func (c *DefaultController) Stop(ctx cell.HookContext) error
type EncryptionKey ¶ added in v1.20.0
type EncryptionKey int
type Manager ¶ added in v1.20.0
type Manager interface {
// contains filtered or unexported methods
}
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.Vec[metric.Observer] //metric.Histogram
}
func NewMetrics ¶ added in v1.15.0
func NewMetrics() *Metrics
type NodeData ¶ added in v1.20.0
type NodeData struct {
// contains filtered or unexported fields
}
NodeData contains information about the node; the set of coreceps on the node and the known encryption key associated with the node. isKeySet indicates whether the encryption key has been explicitly set for the node after seeing a node update event.
func NewNodeData ¶ added in v1.20.0
func NewNodeData() *NodeData
type SecIDs ¶ added in v1.20.0
type SecIDs struct {
// contains filtered or unexported fields
}
SecIDs contains the selected CID, a set of CIDs and a set of CEPs. One CID from the set is selected to maintain compatibility with duplicate identities.
type SharedConfig ¶ added in v1.15.0
type SharedConfig struct {
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.
type SlimController ¶ added in v1.20.0
type SlimController struct {
*Controller
// contains filtered or unexported fields
}
SlimController is the CES controller running in slim mode, creating CES from Pods.
func (*SlimController) Start ¶ added in v1.20.0
func (c *SlimController) Start(ctx cell.HookContext) error
start the worker thread, reconciles the modified CESs with api-server
func (*SlimController) Stop ¶ added in v1.20.0
func (c *SlimController) Stop(ctx cell.HookContext) error