Documentation ¶
Index ¶
- Constants
- Variables
- type IdentityManager
- type PodEndpoint
- type Store
- func (s *Store) AddNamespace(namespace *slim_corev1.Namespace)
- func (s *Store) AddPod(pod *PodEndpoint)
- func (s *Store) DeleteNamespace(key string)
- func (s *Store) DeletePod(key resource.Key)
- func (s *Store) GetNamespace(key string) (*slim_corev1.Namespace, bool)
- func (s *Store) GetPod(key resource.Key) (*PodEndpoint, bool)
- func (s *Store) GetToDeletePod(key resource.Key) (*PodEndpoint, bool)
- func (s *Store) ListPodKeysByNamespace(namespace string) []resource.Key
Constants ¶
const ( RequestTimeout = 15 * time.Second MaxWorkers = 20 )
Variables ¶
var Cell = cell.Module( "endpointcontroller", "controller for cilium endpoint and identity creation and updates", cell.Invoke(registerEndpointController), )
var ErrClientsetDisabled = errors.New("failure due to clientset disabled")
Functions ¶
This section is empty.
Types ¶
type IdentityManager ¶
type IdentityManager struct {
// contains filtered or unexported fields
}
IdentityManager is analogous to Cilium Daemon's identity allocation. Cilium has an IPCacche holding IP to Identity mapping. In IPCache.InjectLabels(), IPCacche is told of IPs which have been updated. Within this function, identities are allocated/released via CachingIdentityAllocator.
func NewIdentityManager ¶
func NewIdentityManager(l logrus.FieldLogger, client versioned.Interface) (*IdentityManager, error)
func (*IdentityManager) DecrementReference ¶
func (im *IdentityManager) DecrementReference(ctx context.Context, lbls labels.Labels)
DecrementReference modifies the corresponding identity's reference count in the allocator's store. For proper garbage collection of stale identities, this must be called exactly once per deleted/relabeled Pod. Whenever reference count is not 0, then the identity will exist in the local store, and syncLocalKeys() will make sure it exists.
func (*IdentityManager) GetIdentityAndIncrementReference ¶
func (im *IdentityManager) GetIdentityAndIncrementReference(ctx context.Context, lbls labels.Labels) (int64, error)
GetIdentityAndIncrementReference will create/get an identity ID and increment the reference count in the allocator's store. For proper garbage collection of stale identities, this must be called exactly once per created/relabeled Pod. Whenever reference count is not 0, then the identity will exist in the local store, and syncLocalKeys() will make sure it exists.
type PodEndpoint ¶
type PodEndpoint struct {
// contains filtered or unexported fields
}
PodEndpoint represents a Pod/CiliumEndpoint
type Store ¶
type Store struct { *sync.RWMutex // Pods is a map of Pod key to PodEndpoint // this is the expected endpoint state for the pod // and is used to determine if the pod needs to be updated Pods map[resource.Key]*PodEndpoint // Namespaces is a map of Namespace name to Namespace // this is used to determine if the namespace needs to be updated Namespaces map[string]*slim_corev1.Namespace }
func (*Store) AddNamespace ¶
func (s *Store) AddNamespace(namespace *slim_corev1.Namespace)
func (*Store) AddPod ¶
func (s *Store) AddPod(pod *PodEndpoint)
func (*Store) DeleteNamespace ¶
func (*Store) GetNamespace ¶
func (s *Store) GetNamespace(key string) (*slim_corev1.Namespace, bool)
func (*Store) GetToDeletePod ¶
func (s *Store) GetToDeletePod(key resource.Key) (*PodEndpoint, bool)