Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a common Node autoscaling safe-to-evict/do-not-disrupt annotation #124800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions staging/src/k8s.io/api/core/v1/annotation_key_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,18 @@ const (
// heuristics will often populate topology hints on EndpointSlices, but that
// is not a requirement.
AnnotationTopologyMode = "service.kubernetes.io/topology-mode"

nodeAutoscalingPrefix = "node-autoscaling.kubernetes.io"

// NodeAutoscalingSafeToEvictKey can be used on a Pod to control Node autoscaler drain behavior:
// - If the value is "false": This pod is not safe to evict, and Node autoscalers shouldn't consolidate a Node where
// such a pod is present.
// - If the value is "true": This pod is safe to evict, and Node autoscalers should not block consolidation of a
// Node because of it, when they normally would. For example, if a Node autoscaler normally blocks consolidating
// Nodes on which kube-system Pods are running, this can be used to opt some pods out of the blocking.
NodeAutoscalingSafeToEvictKey = nodeAutoscalingPrefix + "/safe-to-evict"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this a spec field?

// NodeAutoscalingSafeToEvict is the value indicating that the Pod is safe to evict.
NodeAutoscalingSafeToEvict = "true"
// NodeAutoscalingNotSafeToEvict is the value indicating that the Pod is not safe to evict.
NodeAutoscalingNotSafeToEvict = "false"
)