Documentation ¶
Index ¶
- Constants
- Variables
- func CiliumEndpointsInit(ciliumNPClient cilium_cli.CiliumV2Interface, stopCh <-chan struct{})
- func CiliumEndpointsSliceInit(ciliumNPClient cilium_cli.CiliumV2Interface, ...)
- func HandleNodeTolerationAndTaints(stopCh <-chan struct{})
- func HasCE(ns, name string) (*cilium_api_v2.CiliumEndpoint, bool, error)
- func HasCEWithIdentity(identity string) bool
- func HasCiliumIsUpCondition(n *slim_corev1.Node) bool
- func InitServiceWatcher(cfg ServiceSyncConfiguration, swgSvcs, swgEps *lock.StoppableWaitGroup, ...)
- func PodsInit(k8sClient kubernetes.Interface, stopCh <-chan struct{})
- func RunCiliumNodeGC(ctx context.Context, ciliumNodeStore cache.Store, interval time.Duration)
- func StartLBIPAllocator(ctx context.Context, cfg ServiceSyncConfiguration)
- func StartSynchronizingServices(shared bool, cfg ServiceSyncConfiguration)
- func UnmanagedKubeDNSPodsInit(k8sClient kubernetes.Interface)
- type ServiceGetter
- type ServiceSyncConfiguration
Constants ¶
const PodNodeNameIndex = "pod-node"
Variables ¶
var ( // CiliumEndpointStore contains all CiliumEndpoint present in k8s. // Warning: The CiliumEndpoints stored in the cache are not intended to be // used for Update operations in k8s as some of its fields were are not // populated. CiliumEndpointStore cache.Indexer // CiliumEndpointsSynced is closed once the CiliumEndpointStore is synced // with k8s. CiliumEndpointsSynced = make(chan struct{}) )
var ( // PodStore has a minimal copy of all pods running in the cluster. // Warning: The pods stored in the cache are not intended to be used for Update // operations in k8s as some of its fields are not populated. PodStore cache.Store // PodStoreSynced is closed once the PodStore is synced with k8s. PodStoreSynced = make(chan struct{}) // UnmanagedKubeDNSPodStore has a minimal copy of the unmanaged kube-dns pods running // in the cluster. // Warning: The pods stored in the cache are not intended to be used for Update // operations in k8s as some of its fields are not populated. UnmanagedKubeDNSPodStore cache.Store // UnmanagedPodStoreSynced is closed once the UnmanagedKubeDNSPodStore is synced // with k8s. UnmanagedPodStoreSynced = make(chan struct{}) )
var (
K8sSvcCache = k8s.NewServiceCache(nil)
)
Functions ¶
func CiliumEndpointsInit ¶
func CiliumEndpointsInit(ciliumNPClient cilium_cli.CiliumV2Interface, stopCh <-chan struct{})
CiliumEndpointsInit starts a CiliumEndpointWatcher
func CiliumEndpointsSliceInit ¶
func CiliumEndpointsSliceInit(ciliumNPClient cilium_cli.CiliumV2Interface, cbController *ces.CiliumEndpointSliceController)
CiliumEndpointsSliceInit starts a CiliumEndpointWatcher and caches cesController locally.
func HandleNodeTolerationAndTaints ¶
func HandleNodeTolerationAndTaints(stopCh <-chan struct{})
HandleNodeTolerationAndTaints remove node
func HasCE ¶
func HasCE(ns, name string) (*cilium_api_v2.CiliumEndpoint, bool, error)
HasCE returns true or false if the Cilium Endpoint store has the endpoint with the given name.
func HasCEWithIdentity ¶
HasCEWithIdentity returns true or false if the Cilium Endpoint store has the given identity.
func HasCiliumIsUpCondition ¶
func HasCiliumIsUpCondition(n *slim_corev1.Node) bool
HasCiliumIsUpCondition returns true if the given k8s node has the cilium node condition set.
func InitServiceWatcher ¶ added in v1.10.0
func InitServiceWatcher( cfg ServiceSyncConfiguration, swgSvcs, swgEps *lock.StoppableWaitGroup, optsModifier func(options *v1meta.ListOptions), )
InitServiceWatcher creates and runs the v1.Service watcher which watches for changes and push changes into ServiceCache.
func PodsInit ¶
func PodsInit(k8sClient kubernetes.Interface, stopCh <-chan struct{})
func RunCiliumNodeGC ¶
RunCiliumNodeGC performs garbage collector for cilium node resource
func StartLBIPAllocator ¶ added in v1.10.0
func StartLBIPAllocator(ctx context.Context, cfg ServiceSyncConfiguration)
StartLBIPAllocator starts the service watcher if it hasn't already and looks for service of type LoadBalancer. Once it finds a service of that type, it will try to allocate an external IP (LoadBalancerIP) for it.
func StartSynchronizingServices ¶
func StartSynchronizingServices(shared bool, cfg ServiceSyncConfiguration)
StartSynchronizingServices starts a controller for synchronizing services from k8s to kvstore 'shared' specifies whether only shared services are synchronized. If 'false' then all services will be synchronized. For clustermesh we only need to synchronize shared services, while for VM support we need to sync all the services.
func UnmanagedKubeDNSPodsInit ¶ added in v1.10.4
func UnmanagedKubeDNSPodsInit(k8sClient kubernetes.Interface)
Types ¶
type ServiceGetter ¶
type ServiceGetter struct {
// contains filtered or unexported fields
}
ServiceGetter is a wrapper for 2 k8sCaches, its intention is for `shortCutK8sCache` to be used until `k8sSvcCacheSynced` is closed, for which `k8sCache` is started to be used.
func NewServiceGetter ¶
func NewServiceGetter(sc *k8s.ServiceCache) *ServiceGetter
NewServiceGetter returns a new ServiceGetter holding 2 k8sCaches
func (*ServiceGetter) GetServiceIP ¶
func (s *ServiceGetter) GetServiceIP(svcID k8s.ServiceID) *loadbalancer.L3n4Addr
GetServiceIP returns the result of GetServiceIP for `s.shortCutK8sCache` until `k8sSvcCacheSynced` is closed. This is helpful as we can have a shortcut of `s.k8sCache` since we can pre-populate `s.shortCutK8sCache` with the entries that we need until `s.k8sCache` is synchronized with kubernetes.
type ServiceSyncConfiguration ¶
type ServiceSyncConfiguration interface { // LocalClusterName must return the local cluster name LocalClusterName() string utils.ServiceConfiguration }
ServiceSyncConfiguration is the required configuration for StartSynchronizingServices