taints

package
v0.0.0-...-fd14076 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
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

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

func CleanDeletionCandidate(node *apiv1.Node, client kube_client.Interface) (bool, error)

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

func GetDeletionCandidateTime(node *apiv1.Node) (*time.Time, error)

GetDeletionCandidateTime returns the date when the node was marked by CA as for delete.

func GetTaintTime

func GetTaintTime(node *apiv1.Node, taintKey string) (*time.Time, error)

GetTaintTime returns the date when the node was marked by CA with the specified taint.

func GetToBeDeletedTime

func GetToBeDeletedTime(node *apiv1.Node) (*time.Time, error)

GetToBeDeletedTime returns the date when the node was marked by CA as for delete.

func HasDeletionCandidateTaint

func HasDeletionCandidateTaint(node *apiv1.Node) bool

HasDeletionCandidateTaint returns true if DeletionCandidate taint is applied on the node.

func HasTaint

func HasTaint(node *apiv1.Node, taintKey string) bool

HasTaint returns true if the specified taint is applied on the node.

func HasToBeDeletedTaint

func HasToBeDeletedTaint(node *apiv1.Node) bool

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

func MarkToBeDeleted(node *apiv1.Node, client kube_client.Interface, cordonNode bool) error

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.

type TaintKeySet

type TaintKeySet map[string]bool

TaintKeySet is a set of taint key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL