diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index 3d910e8124..3ac36089c4 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -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 }} diff --git a/helm/values.yaml b/helm/values.yaml index b0129cf71b..9142b0a2f7 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -65,8 +65,7 @@ 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 @@ -74,6 +73,35 @@ coder: # 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.