Skip to content

Commit ff5968b

Browse files
committed
Add HA to the helm chart
1 parent 8dfc261 commit ff5968b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

helm/templates/coder.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ metadata:
1414
{{- include "coder.labels" . | nindent 4 }}
1515
annotations: {{ toYaml .Values.coder.annotations | nindent 4}}
1616
spec:
17-
# NOTE: this is currently not used as coder v2 does not support high
18-
# availability yet.
19-
# replicas: {{ .Values.coder.replicaCount }}
20-
replicas: 1
17+
replicas: {{ .Values.coder.replicaCount }}
2118
selector:
2219
matchLabels:
2320
{{- include "coder.selectorLabels" . | nindent 6 }}
@@ -38,6 +35,13 @@ spec:
3835
env:
3936
- name: CODER_ADDRESS
4037
value: "0.0.0.0:{{ include "coder.port" . }}"
38+
# Used for inter-pod communication with high-availability.
39+
- name: KUBE_POD_IP
40+
valueFrom:
41+
fieldRef:
42+
fieldPath: status.podIP
43+
- name: CODER_DERP_SERVER_RELAY_ADDRESS
44+
value: "{{ include "coder.portName" . }}://$(KUBE_POD_IP):{{ include "coder.port" . }}"
4145
{{- include "coder.tlsEnv" . | nindent 12 }}
4246
{{- with .Values.coder.env -}}
4347
{{ toYaml . | nindent 12 }}

helm/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# coder -- Primary configuration for `coder server`.
22
coder:
3-
# NOTE: this is currently not used as coder v2 does not support high
4-
# availability yet.
5-
# # coder.replicaCount -- The number of Kubernetes deployment replicas.
6-
# replicaCount: 1
3+
# coder.replicaCount -- The number of Kubernetes deployment replicas.
4+
# This should only be increased if High Availability is enabled.
5+
# This is an Enterprise feature. Contact sales@coder.com.
6+
replicaCount: 1
77

88
# coder.image -- The image to use for Coder.
99
image:

0 commit comments

Comments
 (0)