Skip to content

Commit 18a97c6

Browse files
authored
helm: add affinity, nodeSelectors, tolerations (#4763)
1 parent d225f2c commit 18a97c6

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

helm/templates/coder.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,21 @@ spec:
3030
restartPolicy: Always
3131
{{- with .Values.coder.image.pullSecrets }}
3232
imagePullSecrets:
33-
{{- toYaml . | nindent 8 }}
33+
{{- toYaml . | nindent 8 }}
3434
{{- end }}
3535
terminationGracePeriodSeconds: 60
36+
{{- with .Values.coder.affinity }}
37+
affinity:
38+
{{- toYaml . | nindent 8 }}
39+
{{- end }}
40+
{{- with .Values.coder.tolerations }}
41+
tolerations:
42+
{{- toYaml . | nindent 8 }}
43+
{{- end }}
44+
{{- with .Values.coder.nodeSelector }}
45+
nodeSelector:
46+
{{ toYaml . | nindent 8 }}
47+
{{- end }}
3648
containers:
3749
- name: coder
3850
image: {{ include "coder.image" . | quote }}

helm/values.yaml

+30-2
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,43 @@ coder:
6565

6666
# coder.resources -- The resources to request for Coder. These are optional
6767
# and are not set by default.
68-
resources:
69-
{}
68+
resources: {}
7069
# limits:
7170
# cpu: 100m
7271
# memory: 128Mi
7372
# requests:
7473
# cpu: 100m
7574
# memory: 128Mi
7675

76+
# coder.affinity -- Allows specifying an affinity rule for the `coder` deployment.
77+
# The default rule prefers to schedule coder pods on different
78+
# nodes, which is only applicable if coder.replicaCount is greater than 1.
79+
affinity:
80+
podAntiAffinity:
81+
preferredDuringSchedulingIgnoredDuringExecution:
82+
- podAffinityTerm:
83+
labelSelector:
84+
matchExpressions:
85+
- key: app.coder.com
86+
operator: In
87+
values:
88+
- "true"
89+
topologyKey: kubernetes.io/hostname
90+
weight: 1
91+
92+
# coder.tolerations -- Tolerations for tainted nodes.
93+
# See: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
94+
tolerations: {}
95+
# - key: "key"
96+
# operator: "Equal"
97+
# value: "value"
98+
# effect: "NoSchedule"
99+
100+
# coder.nodeSelector -- Node labels for constraining coder pods to nodes.
101+
# See: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
102+
nodeSelector: {}
103+
# kubernetes.io/os: linux
104+
77105
# coder.service -- The Service object to expose for Coder.
78106
service:
79107
# coder.service.enable -- Whether to create the Service object.

0 commit comments

Comments
 (0)