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

fix: safe-to-evict annotation value #2780

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ spec:
<2> Ignore the `FailedScheduling` event to allow workspace startup to continue when a new node is provisioned.

== When the autoscaler removes a node
To prevent workspace pods from being evicted when the autoscaler needs to remove a node, add the `"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"` annotation to every workspace pod.
To prevent workspace pods from being evicted when the autoscaler needs to remove a node, add the `"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"` annotation to every workspace pod.

.Procedure

. In the CheCluster Custom Resource, add the `cluster-autoscaler.kubernetes.io/safe-to-evict: "true"` annotation in the `spec.devEnvironments.workspacesPodAnnotations` field.
. In the CheCluster Custom Resource, add the `cluster-autoscaler.kubernetes.io/safe-to-evict: "false"` annotation in the `spec.devEnvironments.workspacesPodAnnotations` field.
+
[source,yaml,subs="+quotes,+attributes"]
----
spec:
devEnvironments:
workspacesPodAnnotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
----

.Verification steps

. Start a workspace and verify that the workspace pod contains the `cluster-autoscaler.kubernetes.io/safe-to-evict: "true"` annotation.
. Start a workspace and verify that the workspace pod contains the `cluster-autoscaler.kubernetes.io/safe-to-evict: "false"` annotation.
+
[subs="+attributes,+quotes"]
----
$ {orch-cli} get pod __<workspace_pod_name>__ -o jsonpath='{.metadata.annotations.cluster-autoscaler\.kubernetes\.io/safe-to-evict}'
true
false
----
Loading