Skip to content

Commit

Permalink
helm: add affinity, nodeSelectors, tolerations (#4763)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpaulsen committed Nov 9, 2022
1 parent d225f2c commit 18a97c6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
14 changes: 13 additions & 1 deletion helm/templates/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,21 @@ spec:
restartPolicy: Always
{{- with .Values.coder.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 60
{{- with .Values.coder.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
containers:
- name: coder
image: {{ include "coder.image" . | quote }}
Expand Down
32 changes: 30 additions & 2 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,43 @@ coder:

# coder.resources -- The resources to request for Coder. These are optional
# and are not set by default.
resources:
{}
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

# coder.affinity -- Allows specifying an affinity rule for the `coder` deployment.
# The default rule prefers to schedule coder pods on different
# nodes, which is only applicable if coder.replicaCount is greater than 1.
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.coder.com
operator: In
values:
- "true"
topologyKey: kubernetes.io/hostname
weight: 1

# coder.tolerations -- Tolerations for tainted nodes.
# See: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: {}
# - key: "key"
# operator: "Equal"
# value: "value"
# effect: "NoSchedule"

# coder.nodeSelector -- Node labels for constraining coder pods to nodes.
# See: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
nodeSelector: {}
# kubernetes.io/os: linux

# coder.service -- The Service object to expose for Coder.
service:
# coder.service.enable -- Whether to create the Service object.
Expand Down

0 comments on commit 18a97c6

Please sign in to comment.