|
1 | 1 | ---
|
2 |
| -{{- include "libcoder.serviceaccount" (list . "coder.serviceaccount") -}} |
3 |
| -{{- define "coder.serviceaccount" -}} |
4 |
| -{{- end }} |
| 2 | +{{ include "libcoder.serviceaccount" (list . "coder.serviceaccount") }} |
5 | 3 |
|
6 | 4 | ---
|
7 |
| -{{ include "libcoder.deployment" (list . "coder.deployment") -}} |
8 |
| -{{- define "coder.deployment" -}} |
9 |
| -spec: |
10 |
| - template: |
11 |
| - spec: |
12 |
| - containers: |
13 |
| - - |
14 |
| -{{ include "libcoder.containerspec" (list . "coder.containerspec") | indent 8}} |
15 |
| - |
16 |
| -{{- end }} |
17 |
| - |
18 |
| -{{- define "coder.containerspec" -}} |
19 |
| -args: |
20 |
| -{{- if .Values.coder.commandArgs }} |
21 |
| - {{- toYaml .Values.coder.commandArgs | nindent 12 }} |
22 |
| -{{- else }} |
23 |
| - {{- if .Values.coder.workspaceProxy }} |
24 |
| -- wsproxy |
25 |
| - {{- end }} |
26 |
| -- server |
27 |
| -{{- end }} |
28 |
| -env: |
29 |
| -- name: CODER_HTTP_ADDRESS |
30 |
| - value: "0.0.0.0:8080" |
31 |
| -- name: CODER_PROMETHEUS_ADDRESS |
32 |
| - value: "0.0.0.0:2112" |
33 |
| -{{- if .Values.provisionerDaemon.pskSecretName }} |
34 |
| -- name: CODER_PROVISIONER_DAEMON_PSK |
35 |
| - valueFrom: |
36 |
| - secretKeyRef: |
37 |
| - name: {{ .Values.provisionerDaemon.pskSecretName | quote }} |
38 |
| - key: psk |
39 |
| -{{- end }} |
40 |
| - # Set the default access URL so a `helm apply` works by default. |
41 |
| - # See: https://github.com/coder/coder/issues/5024 |
42 |
| -{{- $hasAccessURL := false }} |
43 |
| -{{- range .Values.coder.env }} |
44 |
| -{{- if eq .name "CODER_ACCESS_URL" }} |
45 |
| -{{- $hasAccessURL = true }} |
46 |
| -{{- end }} |
47 |
| -{{- end }} |
48 |
| -{{- if not $hasAccessURL }} |
49 |
| -- name: CODER_ACCESS_URL |
50 |
| - value: {{ include "coder.defaultAccessURL" . | quote }} |
51 |
| -{{- end }} |
52 |
| -# Used for inter-pod communication with high-availability. |
53 |
| -- name: KUBE_POD_IP |
54 |
| - valueFrom: |
55 |
| - fieldRef: |
56 |
| - fieldPath: status.podIP |
57 |
| -- name: CODER_DERP_SERVER_RELAY_URL |
58 |
| - value: "http://$(KUBE_POD_IP):8080" |
59 |
| -{{- include "coder.tlsEnv" . }} |
60 |
| -{{- with .Values.coder.env }} |
61 |
| -{{ toYaml . }} |
62 |
| -{{- end }} |
63 |
| -ports: |
64 |
| -- name: "http" |
65 |
| - containerPort: 8080 |
66 |
| - protocol: TCP |
67 |
| - {{- if eq (include "coder.tlsEnabled" .) "true" }} |
68 |
| -- name: "https" |
69 |
| - containerPort: 8443 |
70 |
| - protocol: TCP |
71 |
| - {{- end }} |
72 |
| - {{- range .Values.coder.env }} |
73 |
| - {{- if eq .name "CODER_PROMETHEUS_ENABLE" }} |
74 |
| - {{/* |
75 |
| - This sadly has to be nested to avoid evaluating the second part |
76 |
| - of the condition too early and potentially getting type errors if |
77 |
| - the value is not a string (like a `valueFrom`). We do not support |
78 |
| - `valueFrom` for this env var specifically. |
79 |
| - */}} |
80 |
| - {{- if eq .value "true" }} |
81 |
| -- name: "prometheus-http" |
82 |
| - containerPort: 2112 |
83 |
| - protocol: TCP |
84 |
| - {{- end }} |
85 |
| - {{- end }} |
86 |
| - {{- end }} |
87 |
| -readinessProbe: |
88 |
| - httpGet: |
89 |
| - path: /healthz |
90 |
| - port: "http" |
91 |
| - scheme: "HTTP" |
92 |
| -livenessProbe: |
93 |
| - httpGet: |
94 |
| - path: /healthz |
95 |
| - port: "http" |
96 |
| - scheme: "HTTP" |
97 |
| -{{- end }} |
| 5 | +{{ include "libcoder.deployment" (list . "coder.deployment") }} |
0 commit comments