Documentation ¶
Index ¶
Constants ¶
const ( // LabelResource indicates resources that the metrics are attributed to. LabelResource = "resource" // LabelPhase indicates the phases the metrics are attributed to. LabelPhase = "phase" LabelValueCID = "cid" LabelValuePod = "pod" LabelValueEnqueuedLatency = "enqueued" LabelValueProcessingLatency = "processing" )
Variables ¶
var Cell = cell.Module( "k8s-cid-controller", "Cilium Identity Controller Operator", cell.Invoke(registerController), metrics.Metric(NewMetrics), cell.Config(defaultConfig), )
Cell implements the CID Controller. It subscribes to CID, CES, Pods and Namespace events and reconciles the state of CID in the cluster.
Functions ¶
This section is empty.
Types ¶
type CIDItem ¶
type CIDItem struct {
// contains filtered or unexported fields
}
type CIDState ¶
type CIDState struct {
// contains filtered or unexported fields
}
func NewCIDState ¶
func (*CIDState) LookupByID ¶
func (c *CIDState) LookupByID(id string) (*key.GlobalIdentity, bool)
func (*CIDState) LookupByKey ¶
func (c *CIDState) LookupByKey(k *key.GlobalIdentity) (string, bool)
type CIDUsageInCES ¶
type CIDUsageInCES struct {
// contains filtered or unexported fields
}
func NewCIDUsageInCES ¶
func NewCIDUsageInCES() *CIDUsageInCES
func (*CIDUsageInCES) CIDUsageCount ¶
func (c *CIDUsageInCES) CIDUsageCount(cidName string) int
func (*CIDUsageInCES) ProcessCESDelete ¶
func (c *CIDUsageInCES) ProcessCESDelete(cesName string, endpoints []v2alpha1.CoreCiliumEndpoint) []int64
ProcessCESDelete reduces the CID usage in CES, based on the provided CES.
func (*CIDUsageInCES) ProcessCESUpsert ¶
func (c *CIDUsageInCES) ProcessCESUpsert(cesName string, endpoints []v2alpha1.CoreCiliumEndpoint) []int64
ProcessCESUpsert updates the CID usage in CES based on the provided CES. When the CES is new, it will just add all used CIDs. When CES is updated, it uses previous CID usage for the same CES, that it tracks, to accordingly reduce CID usage in CES.
type CIDUsageInPods ¶
type CIDUsageInPods struct {
// contains filtered or unexported fields
}
func NewCIDUsageInPods ¶
func NewCIDUsageInPods() *CIDUsageInPods
func (*CIDUsageInPods) AssignCIDToPod ¶
func (c *CIDUsageInPods) AssignCIDToPod(podName, cidName string) (string, int)
AssignCIDToPod updates the pod to CID map and increments the CID usage. It also decrements the previous CID usage and returns the CID name of previously set CID and its usage count after decrementing the CID usage. The return values are used to track when old CIDs are no longer used.
func (*CIDUsageInPods) CIDUsageCount ¶
func (c *CIDUsageInPods) CIDUsageCount(cidName string) int
func (*CIDUsageInPods) RemovePod ¶
func (c *CIDUsageInPods) RemovePod(podName string) (string, int, bool)
RemovePod removes the pod from the pod to CID map, decrements the CID usage and returns the CID name and its usage count after decrementing the usage. If the pod does not exist in the pod to CID map it returns empty values. The return values are used to track when old CIDs are no longer used.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) Start ¶
func (c *Controller) Start(_ cell.HookContext) error
func (*Controller) Stop ¶
func (c *Controller) Stop(_ cell.HookContext) error
type EnqueueTimeTracker ¶
type EnqueueTimeTracker struct {
// contains filtered or unexported fields
}
EnqueueTimeTracker provides a thread safe mechanism to record and manage the time when items are enqueued.
func (*EnqueueTimeTracker) GetAndReset ¶
func (e *EnqueueTimeTracker) GetAndReset(item string) (time.Time, bool)
func (*EnqueueTimeTracker) Track ¶
func (e *EnqueueTimeTracker) Track(item string)
type Metrics ¶
type Metrics struct { EventCount metric.Vec[metric.Counter] QueueLatency metric.Vec[metric.Observer] }
func NewMetrics ¶
func NewMetrics() *Metrics
type PodItem ¶
type PodItem struct {
// contains filtered or unexported fields
}
type QueuedItem ¶
type SecIDs ¶
type SecIDs struct {
// contains filtered or unexported fields
}
SecIDs is used to handle duplicate CIDs. Operator itself will not generate duplicate CIDs. This is required when migrating to Operator managing CIDs. Operator is compatible with Agents simultaneously managing CIDs.
type SharedConfig ¶
type SharedConfig struct { // enabled. 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.