Documentation ¶
Index ¶
- func CreateEventRecorder(kubeClient clientset.Interface, recordDuplicatedEvents bool) kube_record.EventRecorder
- func CreateKubeClient(opts config.KubeClientOptions) kube_client.Interface
- func GetKubeConfig(opts config.KubeClientOptions) *rest.Config
- func GetReadinessState(node *apiv1.Node) (isNodeReady bool, lastTransitionTime time.Time, err error)deprecated
- func GetUnreadyNodeCopy(node *apiv1.Node, reason NodeNotReadyReason) *apiv1.Node
- func IsNodeReadyAndSchedulable(node *apiv1.Node) bool
- func NewConfigMapListerForNamespace(kubeClient client.Interface, stopchannel <-chan struct{}, namespace string) v1lister.ConfigMapLister
- func NewTestConfigMapLister(cms []*apiv1.ConfigMap) (v1lister.ConfigMapLister, error)
- func NewTestDaemonSetLister(dss []*appsv1.DaemonSet) (v1appslister.DaemonSetLister, error)
- func NewTestJobLister(jobs []*batchv1.Job) (v1batchlister.JobLister, error)
- func NewTestReplicaSetLister(rss []*appsv1.ReplicaSet) (v1appslister.ReplicaSetLister, error)
- func NewTestReplicationControllerLister(rcs []*apiv1.ReplicationController) (v1lister.ReplicationControllerLister, error)
- func NewTestStatefulSetLister(sss []*appsv1.StatefulSet) (v1appslister.StatefulSetLister, error)
- func ScheduledPods(allPods []*apiv1.Pod) []*apiv1.Pod
- func SchedulerUnprocessedPods(allPods []*apiv1.Pod, bypassedSchedulers map[string]bool) []*apiv1.Pod
- func UnschedulablePods(allPods []*apiv1.Pod) []*apiv1.Pod
- func WrapEventSinkWithLogging(sink record.EventSink) record.EventSink
- type AllPodLister
- type ListerRegistry
- type NodeLister
- type NodeNotReadyReason
- type NodeReadiness
- type PodDisruptionBudgetLister
- type PodDisruptionBudgetListerImpl
- type PodLister
- type TestNodeLister
- type TestPodDisruptionBudgetLister
- type TestPodLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEventRecorder ¶
func CreateEventRecorder(kubeClient clientset.Interface, recordDuplicatedEvents bool) kube_record.EventRecorder
CreateEventRecorder creates an event recorder to send custom events to Kubernetes to be recorded for targeted Kubernetes objects
func CreateKubeClient ¶
func CreateKubeClient(opts config.KubeClientOptions) kube_client.Interface
CreateKubeClient creates kube client based on AutoscalingOptions.KubeClientOptions
func GetKubeConfig ¶
func GetKubeConfig(opts config.KubeClientOptions) *rest.Config
GetKubeConfig returns the rest config from AutoscalingOptions.KubeClientOptions.
func GetUnreadyNodeCopy ¶
func GetUnreadyNodeCopy(node *apiv1.Node, reason NodeNotReadyReason) *apiv1.Node
GetUnreadyNodeCopy create a copy of the given node and override its NodeReady condition to False
func IsNodeReadyAndSchedulable ¶
IsNodeReadyAndSchedulable returns true if the node is ready and schedulable.
func NewConfigMapListerForNamespace ¶
func NewConfigMapListerForNamespace(kubeClient client.Interface, stopchannel <-chan struct{}, namespace string) v1lister.ConfigMapLister
NewConfigMapListerForNamespace builds a configmap lister for the passed namespace (including all).
func NewTestConfigMapLister ¶
func NewTestConfigMapLister(cms []*apiv1.ConfigMap) (v1lister.ConfigMapLister, error)
NewTestConfigMapLister returns a lister that returns provided ConfigMaps
func NewTestDaemonSetLister ¶
func NewTestDaemonSetLister(dss []*appsv1.DaemonSet) (v1appslister.DaemonSetLister, error)
NewTestDaemonSetLister returns a lister that returns provided DaemonSets
func NewTestJobLister ¶
func NewTestJobLister(jobs []*batchv1.Job) (v1batchlister.JobLister, error)
NewTestJobLister returns a lister that returns provided Jobs
func NewTestReplicaSetLister ¶
func NewTestReplicaSetLister(rss []*appsv1.ReplicaSet) (v1appslister.ReplicaSetLister, error)
NewTestReplicaSetLister returns a lister that returns provided ReplicaSets
func NewTestReplicationControllerLister ¶
func NewTestReplicationControllerLister(rcs []*apiv1.ReplicationController) (v1lister.ReplicationControllerLister, error)
NewTestReplicationControllerLister returns a lister that returns provided ReplicationControllers
func NewTestStatefulSetLister ¶
func NewTestStatefulSetLister(sss []*appsv1.StatefulSet) (v1appslister.StatefulSetLister, error)
NewTestStatefulSetLister returns a lister that returns provided StatefulSets
func ScheduledPods ¶
ScheduledPods is a helper method that returns all scheduled pods from given pod list.
func SchedulerUnprocessedPods ¶
func SchedulerUnprocessedPods(allPods []*apiv1.Pod, bypassedSchedulers map[string]bool) []*apiv1.Pod
SchedulerUnprocessedPods is a helper method that returns all pods which are not yet processed by the specified bypassed schedulers
func UnschedulablePods ¶
UnschedulablePods is a helper method that returns all unschedulable pods from given pod list.
Types ¶
type AllPodLister ¶
type AllPodLister struct {
// contains filtered or unexported fields
}
AllPodLister lists all pods.
type ListerRegistry ¶
type ListerRegistry interface { AllNodeLister() NodeLister ReadyNodeLister() NodeLister AllPodLister() PodLister PodDisruptionBudgetLister() PodDisruptionBudgetLister DaemonSetLister() v1appslister.DaemonSetLister ReplicationControllerLister() v1lister.ReplicationControllerLister JobLister() v1batchlister.JobLister ReplicaSetLister() v1appslister.ReplicaSetLister StatefulSetLister() v1appslister.StatefulSetLister }
ListerRegistry is a registry providing various listers to list pods or nodes matching conditions
func NewListerRegistry ¶
func NewListerRegistry(allNode NodeLister, readyNode NodeLister, allPodLister PodLister, podDisruptionBudgetLister PodDisruptionBudgetLister, daemonSetLister v1appslister.DaemonSetLister, replicationControllerLister v1lister.ReplicationControllerLister, jobLister v1batchlister.JobLister, replicaSetLister v1appslister.ReplicaSetLister, statefulSetLister v1appslister.StatefulSetLister) ListerRegistry
NewListerRegistry returns a registry providing various listers to list pods or nodes matching conditions
func NewListerRegistryWithDefaultListers ¶
func NewListerRegistryWithDefaultListers(informerFactory informers.SharedInformerFactory) ListerRegistry
NewListerRegistryWithDefaultListers returns a registry filled with listers of the default implementations
type NodeLister ¶
NodeLister lists nodes.
func NewAllNodeLister ¶
func NewAllNodeLister(nl v1lister.NodeLister) NodeLister
NewAllNodeLister builds a node lister that returns all nodes (ready and unready).
func NewNodeLister ¶
func NewNodeLister(nl v1lister.NodeLister, filter func(*apiv1.Node) bool) NodeLister
NewNodeLister builds a node lister.
func NewReadyNodeLister ¶
func NewReadyNodeLister(nl v1lister.NodeLister) NodeLister
NewReadyNodeLister builds a node lister that returns only ready nodes.
type NodeNotReadyReason ¶
type NodeNotReadyReason string
NodeNotReadyReason reprents a reason for node to be unready. While it is simply a string on the node object, custom type ensures no one accidentally performs any string operation on variables of this type and allows them to be treated as enums.
const ( // ResourceUnready is a fake identifier used internally by Cluster Autoscaler // to indicate nodes that appear Ready in the API, but are treated as // still upcoming due to a missing resource (e.g. GPU). ResourceUnready NodeNotReadyReason = "cluster-autoscaler.kubernetes.io/resource-not-ready" // StartupNodes is a fake identifier used internally by Cluster Autoscaler // to indicate nodes that appear Ready in the API, but are treated as // still upcoming due to applied startup taint. StartupNodes NodeNotReadyReason = "cluster-autoscaler.kubernetes.io/startup-taint" )
type NodeReadiness ¶
type NodeReadiness struct { // Is the node ready or not. Ready bool // Time of the last state transition related to readiness. LastTransitionTime time.Time // Reason for the node to be unready. Defined only when Ready is false. Reason NodeNotReadyReason }
NodeReadiness represents the last known node readiness.
func GetNodeReadiness ¶
func GetNodeReadiness(node *apiv1.Node) (NodeReadiness, error)
GetNodeReadiness gets readiness for the node
type PodDisruptionBudgetLister ¶
type PodDisruptionBudgetLister interface {
List() ([]*policyv1.PodDisruptionBudget, error)
}
PodDisruptionBudgetLister lists pod disruption budgets.
func NewPodDisruptionBudgetLister ¶
func NewPodDisruptionBudgetLister(pdbLister v1policylister.PodDisruptionBudgetLister) PodDisruptionBudgetLister
NewPodDisruptionBudgetLister builds a pod disruption budget lister.
func NewTestPodDisruptionBudgetLister ¶
func NewTestPodDisruptionBudgetLister(pdbs []*policyv1.PodDisruptionBudget) PodDisruptionBudgetLister
NewTestPodDisruptionBudgetLister returns a lister that returns provided pod disruption budgets
type PodDisruptionBudgetListerImpl ¶
type PodDisruptionBudgetListerImpl struct {
// contains filtered or unexported fields
}
PodDisruptionBudgetListerImpl lists pod disruption budgets
func (*PodDisruptionBudgetListerImpl) List ¶
func (lister *PodDisruptionBudgetListerImpl) List() ([]*policyv1.PodDisruptionBudget, error)
List returns all pdbs
type PodLister ¶
PodLister lists all pods. To filter out the scheduled or unschedulable pods the helper methods ScheduledPods and UnschedulablePods should be used.
func NewAllPodLister ¶
NewAllPodLister builds AllPodLister
func NewTestPodLister ¶
NewTestPodLister returns a lister that returns provided pods
type TestNodeLister ¶
type TestNodeLister struct {
// contains filtered or unexported fields
}
TestNodeLister is used in tests involving listers
func NewTestNodeLister ¶
func NewTestNodeLister(nodes []*apiv1.Node) *TestNodeLister
NewTestNodeLister returns a lister that returns provided nodes
func (*TestNodeLister) Get ¶
func (l *TestNodeLister) Get(name string) (*apiv1.Node, error)
Get returns node from test lister.
func (*TestNodeLister) List ¶
func (l *TestNodeLister) List() ([]*apiv1.Node, error)
List returns all nodes in test lister.
func (*TestNodeLister) SetNodes ¶
func (l *TestNodeLister) SetNodes(nodes []*apiv1.Node)
SetNodes sets nodes in test lister.
type TestPodDisruptionBudgetLister ¶
type TestPodDisruptionBudgetLister struct {
// contains filtered or unexported fields
}
TestPodDisruptionBudgetLister is used in tests involving listers
func (TestPodDisruptionBudgetLister) List ¶
func (lister TestPodDisruptionBudgetLister) List() ([]*policyv1.PodDisruptionBudget, error)
List returns all pdbs in test lister.
type TestPodLister ¶
type TestPodLister struct {
// contains filtered or unexported fields
}
TestPodLister is used in tests involving listers