Skip to content

Commit

Permalink
Fix outdated workspace nodeSelector documentation (#2690)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig authored Feb 20, 2024
1 parent ea60386 commit bdd2ffa
Showing 1 changed file with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,34 @@
This section describes how to configure link:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/[`nodeSelector`] for Pods of {prod-short} workspaces.

.Procedure

{prod-short} uses the `CHE_WORKSPACE_POD_NODE__SELECTOR` environment variable to configure `nodeSelector`. This variable can contain a set of comma-separated `key=value` pairs to form the nodeSelector rule, or `NULL` to disable it.

.. Using NodeSelector
+
{prod-short} uses `CheCluster` Custom Resource to configure `nodeSelector`:
+
[source,yaml]
----
spec:
devEnvironments:
nodeSelector:
key: value
----
This section must contain a set of `key=value` pairs for each link:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#built-in-node-labels[node label] to form the link:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector[nodeSelector] rule.

.. Using Taints and Tolerations
+
This works in the opposite way to `nodeSelector`. Instead of specifying which nodes the Pod will be scheduled on, you specify which nodes the Pod cannot be scheduled on. For more information, see: link:https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration[].
+
{prod-short} uses `CheCluster` Custom Resource to configure `tolerations`:
+
[source,yaml]
----
CHE_WORKSPACE_POD_NODE__SELECTOR=disktype=ssd,cpu=xlarge,[key=value]
spec:
devEnvironments:
tolerations:
- effect: NoSchedule
key: key
value: value
operator: Equal
----

[IMPORTANT]
Expand All @@ -23,7 +46,7 @@ CHE_WORKSPACE_POD_NODE__SELECTOR=disktype=ssd,cpu=xlarge,[key=value]
To avoid Pods and PVCs to be scheduled in different zones on large, multizone clusters, create an additional link:https://kubernetes.io/docs/concepts/storage/storage-classes/[`StorageClass`] object (pay attention to the `allowedTopologies` field), which will coordinate the PVC creation process.
Pass the name of this newly created `StorageClass` to {prod-short} through the `+CHE_INFRA_KUBERNETES_PVC_STORAGE__CLASS__NAME+` environment variable. A default empty value of this variable instructs {prod-short} to use the cluster's default `StorageClass`.
Pass the name of this newly created `StorageClass` to {prod-short} through the `CheCluster` Custom Resource. For more information, see: xref:configuring-storage-classes.adoc[].
====

.Additional resources
Expand Down

0 comments on commit bdd2ffa

Please sign in to comment.