func LoadKubeconfig(pathOverride string, logger *logr.Logger) (*rest.Config, error)
Loads the Kubernetes config. If the pathOverride is set, we load the KUBECONFIG from there, otherwise we attempt to load it from a pod environment (i.e., when operating inside a cluster). If this fails, we try to use the local KUBECONFIG file.
Kubernetes-specific extension of the ClusterClient.
type KubernetesClusterClient interface { client.LocalClusterClient // Gets the ClientSet for communicating with a Kubernetes cluster. ClientSet() clientset.Interface // Gets the EventRecorder for this cluster. EventRecorder() record.EventRecorder }
Default KubernetesClusterClient implementation.
type KubernetesClusterClientImpl struct {
// contains filtered or unexported fields
}
func NewKubernetesClusterClientImpl( clusterName string, kubeconfig *rest.Config, parentComponentName string, logger *logr.Logger, ) (*KubernetesClusterClientImpl, error)
Creates a new KubernetesClusterClientImpl using the specified kubeconfig.
- clusterName is the name of the cluster to connect to - kubeconfig is the respective kubeconfig - parentComponentName is the name of the component that creates this client (this is used as the source name in the event recorder) - logger the Logger that should be used for logging
func (c *KubernetesClusterClientImpl) ClientSet() clientset.Interface
func (c *KubernetesClusterClientImpl) ClusterName() string
func (c *KubernetesClusterClientImpl) CommitSchedulingDecision(ctx context.Context, schedulingDecision *client.ClusterSchedulingDecision) (*client.CommitSchedulingDecisionSuccess, error)
func (c *KubernetesClusterClientImpl) EventRecorder() record.EventRecorder
func (c *KubernetesClusterClientImpl) FetchNode(ctx context.Context, name string) (*core.Node, error)
func (c *KubernetesClusterClientImpl) FetchPodsScheduledOnNode(ctx context.Context, nodeName string) ([]core.Pod, error)
ClusterClientsManager for Kubernetes.
type KubernetesClusterClientsManager struct { *client.GenericClusterClientsManager[KubernetesClusterClient] }
func NewKubernetesClusterClientsManager(clusterConfigs map[string]*rest.Config, parentComponentName string, logger *logr.Logger) (*KubernetesClusterClientsManager, error)
Creates a new KubernetesClusterClientsManager and initializes it with clients for the specified cluster configurations.
NodesCache implementation for Kubernetes.
type KubernetesNodesCache struct {
// contains filtered or unexported fields
}
func NewKubernetesNodesCache( clusterClient KubernetesClusterClient, updateInterval time.Duration, queueSize int, ) *KubernetesNodesCache
func (knc *KubernetesNodesCache) Nodes() collections.ConcurrentObjectStore[*client.ClusterNode]
func (knc *KubernetesNodesCache) QueuePodOnNode(pod *core.Pod, nodeName string) client.PodQueuedOnNode
func (knc *KubernetesNodesCache) StartWatch(ctx context.Context) error
type KubernetesPodSource struct {
// contains filtered or unexported fields
}
func NewKubernetesPodSource(clusterClientsMgr *KubernetesClusterClientsManager, schedConfig *config.SchedulerConfig) *KubernetesPodSource
Creates a new KubernetesPodSource for all clusters in the specified ClusterClientsManager.
func (kps *KubernetesPodSource) IncomingPods() chan *pipeline.IncomingPod
func (kps *KubernetesPodSource) StartWatching() error
Creates the channel available through IncomingPods() and starts watching for pods.
func (kps *KubernetesPodSource) StopWatching() error
Stops watching for pods and closes the channel available through IncomingPods().