Skip to content

Commit 3208e6e

Browse files
feat: machine autoscaler documentation (#2754)
* feat: machine autoscaler documentation Signed-off-by: dkwon17 <dakwon@redhat.com> * Update modules/administration-guide/pages/configuring-autoscaling.adoc Co-authored-by: Jana Vrbkova <jvrbkova@redhat.com> * Fix PR feedback Signed-off-by: dkwon17 <dakwon@redhat.com> * Remove passive voice Signed-off-by: dkwon17 <dakwon@redhat.com> --------- Signed-off-by: dkwon17 <dakwon@redhat.com> Co-authored-by: Jana Vrbkova <jvrbkova@redhat.com>
1 parent 4688b47 commit 3208e6e

File tree

3 files changed

+80
-0
lines changed

3 files changed

+80
-0
lines changed

modules/administration-guide/nav.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
** xref:configuring-server-components.adoc[]
3838
*** xref:mounting-a-secret-as-a-file-or-an-environment-variable-into-a-container.adoc[]
3939
*** xref:advanced-configuration-options-for-the-che-server-component.adoc[]
40+
** xref:configuring-autoscaling.adoc[]
4041
*** xref:configuring-number-of-replicas.adoc[]
42+
*** xref:configuring-machine-autoscaling.adoc[]
4143
** xref:configuring-workspaces-globally.adoc[]
4244
*** xref:limiting-the-number-of-workspaces-that-a-user-can-keep.adoc[]
4345
*** xref:enabling-users-to-run-multiple-workspaces-simultaneously.adoc[]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:_content-type: ASSEMBLY
2+
:description: Configuring autoscaling
3+
:keywords: administration-guide, configuring, autoscaling, autoscale, horizontal, scaling, machine
4+
:navtitle: Configuring autoscaling
5+
:page-aliases:
6+
7+
[id="configuring-autoscaling"]
8+
= Configuring autoscaling
9+
10+
Learn about different aspects of autoscaling for {prod}.
11+
12+
* xref:configuring-number-of-replicas.adoc[]
13+
* xref:configuring-machine-autoscaling.adoc[]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
:_content-type: PROCEDURE
2+
:description: Configuring machine autoscaling
3+
:keywords: administration guide, machine, autoscaling, scaling
4+
:navtitle: Configuring machine autoscaling
5+
:page-aliases:
6+
7+
[id="configuring-machine-autoscaling"]
8+
= Configuring machine autoscaling
9+
10+
If you configured the cluster to adjust the number of nodes depending on resource needs, you need additional configuration to maintain the seamless operation of {prod-short} workspaces.
11+
12+
Workspaces need special consideration when the autoscaler adds and removes nodes.
13+
14+
When a new node is being added by the autoscaler, workspace startup can take longer than usual until the node provisioning is complete.
15+
16+
Conversely when a node is being removed, ideally nodes that are running workspace pods should not be evicted by the autoscaler to avoid any interruptions while using the workspace and potentially losing any unsaved data.
17+
18+
== When the autoscaler adds a new node
19+
You need to make additional configurations to the {prod-short} installation to ensure proper workspace startup while a new node is being added.
20+
21+
.Procedure
22+
23+
. In the CheCluster Custom Resource, set the `spec.devEnvironments.startTimeoutSeconds` field to at least 600 seconds to allow time for a new node to be provisioned when needed during workspace startup.
24+
+
25+
[source,yaml,subs="+quotes,+attributes"]
26+
----
27+
spec:
28+
devEnvironments:
29+
startTimeoutSeconds: 600
30+
----
31+
32+
. In the DevWorkspaceOperatorConfig Custom Resource in the {prod-namespace} namespace, add the `FailedScheduling` event to the `config.workpsace.ignoredUnrecoverableEvents` field. This allows the workspace startup to not fail if not enough nodes are available. When the new node is provisioned, this allows the workspace startup to continue.
33+
+
34+
[source,yaml,subs="+quotes,+attributes"]
35+
----
36+
config:
37+
workspace:
38+
ignoredUnrecoverableEvents:
39+
- FailedScheduling
40+
----
41+
42+
== When the autoscaler removes a node
43+
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.
44+
45+
.Procedure
46+
47+
. In the CheCluster Custom Resource, add the `cluster-autoscaler.kubernetes.io/safe-to-evict: "true"` annotation in the `spec.devEnvironments.workspacesPodAnnotations` field.
48+
+
49+
[source,yaml,subs="+quotes,+attributes"]
50+
----
51+
spec:
52+
devEnvironments:
53+
workspacesPodAnnotations:
54+
cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
55+
----
56+
57+
.Verification steps
58+
59+
. Start a workspace and verify that the workspace pod contains the `cluster-autoscaler.kubernetes.io/safe-to-evict: "true"` annotation.
60+
+
61+
[subs="+attributes,+quotes"]
62+
----
63+
$ {orch-cli} get pod __<workspace_pod_name>__ -o jsonpath='{.metadata.annotations.cluster-autoscaler\.kubernetes\.io/safe-to-evict}'
64+
true
65+
----

0 commit comments

Comments
 (0)