Documentation ¶
Index ¶
- Constants
- Variables
- func AddTaints(node *apiv1.Node, client kube_client.Interface, taints []apiv1.Taint, ...) error
- func CleanAllDeletionCandidates(nodes []*apiv1.Node, client kube_client.Interface, ...)
- func CleanAllTaints(nodes []*apiv1.Node, client kube_client.Interface, ...)
- func CleanAllToBeDeleted(nodes []*apiv1.Node, client kube_client.Interface, ...)
- func CleanDeletionCandidate(node *apiv1.Node, client kube_client.Interface) (bool, error)
- func CleanTaints(node *apiv1.Node, client kube_client.Interface, taintKeys []string, ...) (bool, error)
- func CleanToBeDeleted(node *apiv1.Node, client kube_client.Interface, cordonNode bool) (bool, error)
- func CountNodeTaints(nodes []*apiv1.Node, taintConfig TaintConfig) map[string]int
- func FilterOutNodesWithStartupTaints(taintConfig TaintConfig, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)
- func GetDeletionCandidateTime(node *apiv1.Node) (*time.Time, error)
- func GetTaintTime(node *apiv1.Node, taintKey string) (*time.Time, error)
- func GetToBeDeletedTime(node *apiv1.Node) (*time.Time, error)
- func HasDeletionCandidateTaint(node *apiv1.Node) bool
- func HasTaint(node *apiv1.Node, taintKey string) bool
- func HasToBeDeletedTaint(node *apiv1.Node) bool
- func MarkDeletionCandidate(node *apiv1.Node, client kube_client.Interface) error
- func MarkToBeDeleted(node *apiv1.Node, client kube_client.Interface, cordonNode bool) error
- func SanitizeTaints(taints []apiv1.Taint, taintConfig TaintConfig) []apiv1.Taint
- type TaintConfig
- type TaintKeySet
Constants ¶
const ( // ToBeDeletedTaint is a taint used to make the node unschedulable. ToBeDeletedTaint = "ToBeDeletedByClusterAutoscaler" // DeletionCandidateTaint is a taint used to mark unneeded node as preferably unschedulable. DeletionCandidateTaint = "DeletionCandidateOfClusterAutoscaler" // IgnoreTaintPrefix any taint starting with it will be filtered out from autoscaler template node. IgnoreTaintPrefix = "ignore-taint.cluster-autoscaler.kubernetes.io/" // StartupTaintPrefix (Same as IgnoreTaintPrefix) any taint starting with it will be filtered out from autoscaler template node. StartupTaintPrefix = "startup-taint.cluster-autoscaler.kubernetes.io/" // StatusTaintPrefix any taint starting with it will be filtered out from autoscaler template node but unlike IgnoreTaintPrefix & StartupTaintPrefix it should not be trated as unready. StatusTaintPrefix = "status-taint.cluster-autoscaler.kubernetes.io/" )
Variables ¶
var ( // NodeConditionTaints lists taint keys used as node conditions NodeConditionTaints = TaintKeySet{ apiv1.TaintNodeNotReady: true, apiv1.TaintNodeUnreachable: true, apiv1.TaintNodeUnschedulable: true, apiv1.TaintNodeMemoryPressure: true, apiv1.TaintNodeDiskPressure: true, apiv1.TaintNodeNetworkUnavailable: true, apiv1.TaintNodePIDPressure: true, cloudproviderapi.TaintExternalCloudProvider: true, cloudproviderapi.TaintNodeShutdown: true, // contains filtered or unexported fields } )
Functions ¶
func AddTaints ¶
func AddTaints(node *apiv1.Node, client kube_client.Interface, taints []apiv1.Taint, cordonNode bool) error
AddTaints sets the specified taints on the node.
func CleanAllDeletionCandidates ¶
func CleanAllDeletionCandidates(nodes []*apiv1.Node, client kube_client.Interface, recorder kube_record.EventRecorder)
CleanAllDeletionCandidates cleans DeletionCandidate taints from given nodes.
func CleanAllTaints ¶
func CleanAllTaints(nodes []*apiv1.Node, client kube_client.Interface, recorder kube_record.EventRecorder, taintKeys []string, cordonNode bool)
CleanAllTaints cleans all specified taints from given nodes.
func CleanAllToBeDeleted ¶
func CleanAllToBeDeleted(nodes []*apiv1.Node, client kube_client.Interface, recorder kube_record.EventRecorder, cordonNode bool)
CleanAllToBeDeleted cleans ToBeDeleted taints from given nodes.
func CleanDeletionCandidate ¶
CleanDeletionCandidate cleans CA's soft NoSchedule taint from a node.
func CleanTaints ¶
func CleanTaints(node *apiv1.Node, client kube_client.Interface, taintKeys []string, cordonNode bool) (bool, error)
CleanTaints cleans the specified taints from a node.
func CleanToBeDeleted ¶
func CleanToBeDeleted(node *apiv1.Node, client kube_client.Interface, cordonNode bool) (bool, error)
CleanToBeDeleted cleans CA's NoSchedule taint from a node.
func CountNodeTaints ¶
func CountNodeTaints(nodes []*apiv1.Node, taintConfig TaintConfig) map[string]int
CountNodeTaints counts used node taints.
func FilterOutNodesWithStartupTaints ¶
func FilterOutNodesWithStartupTaints(taintConfig TaintConfig, allNodes, readyNodes []*apiv1.Node) ([]*apiv1.Node, []*apiv1.Node)
FilterOutNodesWithStartupTaints override the condition status of the given nodes to mark them as NotReady when they have filtered taints.
func GetDeletionCandidateTime ¶
GetDeletionCandidateTime returns the date when the node was marked by CA as for delete.
func GetTaintTime ¶
GetTaintTime returns the date when the node was marked by CA with the specified taint.
func GetToBeDeletedTime ¶
GetToBeDeletedTime returns the date when the node was marked by CA as for delete.
func HasDeletionCandidateTaint ¶
HasDeletionCandidateTaint returns true if DeletionCandidate taint is applied on the node.
func HasToBeDeletedTaint ¶
HasToBeDeletedTaint returns true if ToBeDeleted taint is applied on the node.
func MarkDeletionCandidate ¶
func MarkDeletionCandidate(node *apiv1.Node, client kube_client.Interface) error
MarkDeletionCandidate sets a soft taint that makes the node preferably unschedulable.
func MarkToBeDeleted ¶
MarkToBeDeleted sets a taint that makes the node unschedulable.
func SanitizeTaints ¶
func SanitizeTaints(taints []apiv1.Taint, taintConfig TaintConfig) []apiv1.Taint
SanitizeTaints returns filtered taints
Types ¶
type TaintConfig ¶
type TaintConfig struct {
// contains filtered or unexported fields
}
TaintConfig is a config of taints that require special handling
func NewTaintConfig ¶
func NewTaintConfig(opts config.AutoscalingOptions) TaintConfig
NewTaintConfig returns the taint config extracted from options
func (TaintConfig) IsStartupTaint ¶
func (tc TaintConfig) IsStartupTaint(taint string) bool
IsStartupTaint checks whether given taint is a startup taint.
func (TaintConfig) IsStatusTaint ¶
func (tc TaintConfig) IsStatusTaint(taint string) bool
IsStatusTaint checks whether given taint is a status taint.