Documentation ¶
Index ¶
- Constants
- type K8sWatcher
- func (k *K8sWatcher) EnableK8sWatcher(queueSize uint) error
- func (k *K8sWatcher) GetAPIGroups() []string
- func (k *K8sWatcher) GetCachedNamespace(namespace string) (*types.Namespace, error)
- func (k *K8sWatcher) GetCachedPod(namespace, name string) (*types.Pod, error)
- func (k *K8sWatcher) InitK8sSubsystem() <-chan struct{}
- func (k *K8sWatcher) K8sEventProcessed(scope string, action string, status bool)
- func (k *K8sWatcher) K8sEventReceived(scope string, action string, valid, equal bool)
- func (k *K8sWatcher) RunK8sServiceHandler()
- func (k *K8sWatcher) WaitForCacheSync(resourceNames ...string)
Constants ¶
const ( K8sAPIGroupServiceV1Core = "core/v1::Service" K8sAPIGroupEndpointV1Core = "core/v1::Endpoint" K8sAPIGroupEndpointSliceV1Beta1Discovery = "discovery/v1beta1::EndpointSlice" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type K8sWatcher ¶
type K8sWatcher struct { // K8sSvcCache is a cache of all Kubernetes services and endpoints K8sSvcCache k8s.ServiceCache // contains filtered or unexported fields }
func NewK8sWatcher ¶
func NewK8sWatcher( endpointManager endpointManager, nodeDiscoverManager nodeDiscoverManager, policyManager policyManager, policyRepository policyRepository, svcManager svcManager, ) *K8sWatcher
func (*K8sWatcher) EnableK8sWatcher ¶ added in v1.7.0
func (k *K8sWatcher) EnableK8sWatcher(queueSize uint) error
EnableK8sWatcher watches for policy, services and endpoint changes on the Kubernetes api server defined in the receiver's daemon k8sClient. queueSize specifies the queue length used to serialize k8s events.
func (*K8sWatcher) GetAPIGroups ¶
func (k *K8sWatcher) GetAPIGroups() []string
func (*K8sWatcher) GetCachedNamespace ¶
func (k *K8sWatcher) GetCachedNamespace(namespace string) (*types.Namespace, error)
GetCachedNamespace returns a namespace from the local store.
func (*K8sWatcher) GetCachedPod ¶
func (k *K8sWatcher) GetCachedPod(namespace, name string) (*types.Pod, error)
GetCachedPod returns a pod from the local store. Depending if the Cilium agent flag `option.Config.K8sEventHandover` this function might only return local pods. If `option.Config.K8sEventHandover` is:
- true: returns only local pods received by the pod watcher.
- false: returns any pod in the cluster received by the pod watcher.
func (*K8sWatcher) InitK8sSubsystem ¶
func (k *K8sWatcher) InitK8sSubsystem() <-chan struct{}
InitK8sSubsystem returns a channel for which it will be closed when all caches essential for daemon are synchronized.
func (*K8sWatcher) K8sEventProcessed ¶
func (k *K8sWatcher) K8sEventProcessed(scope string, action string, status bool)
K8sEventProcessed is called to do metrics accounting for each processed Kubernetes event
func (*K8sWatcher) K8sEventReceived ¶
func (k *K8sWatcher) K8sEventReceived(scope string, action string, valid, equal bool)
K8sEventReceived does metric accounting for each received Kubernetes event
func (*K8sWatcher) RunK8sServiceHandler ¶
func (k *K8sWatcher) RunK8sServiceHandler()
func (*K8sWatcher) WaitForCacheSync ¶
func (k *K8sWatcher) WaitForCacheSync(resourceNames ...string)
WaitForCacheSync waits for k8s caches to be synchronized for the given resource. Returns once all resourcesNames are synchronized with cilium-agent.