2022-10-04 11:45:21 +00:00
|
|
|
{{- include "coder.verifyDeprecated" . -}}
|
2022-08-25 19:32:35 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
2023-01-31 06:35:32 +00:00
|
|
|
name: {{ .Values.coder.serviceAccount.name | quote }}
|
2022-10-19 13:49:48 +00:00
|
|
|
annotations: {{ toYaml .Values.coder.serviceAccount.annotations | nindent 4 }}
|
|
|
|
labels:
|
|
|
|
{{- include "coder.labels" . | nindent 4 }}
|
2022-08-25 19:32:35 +00:00
|
|
|
---
|
2022-07-26 18:19:29 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: coder
|
|
|
|
labels:
|
|
|
|
{{- include "coder.labels" . | nindent 4 }}
|
2023-04-06 07:03:21 +00:00
|
|
|
{{- with .Values.coder.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2022-10-03 18:31:34 +00:00
|
|
|
annotations: {{ toYaml .Values.coder.annotations | nindent 4}}
|
2022-07-26 18:19:29 +00:00
|
|
|
spec:
|
2022-10-17 13:43:30 +00:00
|
|
|
replicas: {{ .Values.coder.replicaCount }}
|
2022-07-26 18:19:29 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "coder.selectorLabels" . | nindent 6 }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2023-01-20 05:31:05 +00:00
|
|
|
{{- include "coder.labels" . | nindent 8 }}
|
2023-04-14 18:55:38 +00:00
|
|
|
{{- with .Values.coder.podLabels }}
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2023-03-22 18:35:24 +00:00
|
|
|
annotations:
|
|
|
|
{{- toYaml .Values.coder.podAnnotations | nindent 8 }}
|
2022-07-26 18:19:29 +00:00
|
|
|
spec:
|
2023-01-31 06:35:32 +00:00
|
|
|
serviceAccountName: {{ .Values.coder.serviceAccount.name | quote }}
|
2022-07-26 18:19:29 +00:00
|
|
|
restartPolicy: Always
|
2022-10-24 17:24:21 +00:00
|
|
|
{{- with .Values.coder.image.pullSecrets }}
|
|
|
|
imagePullSecrets:
|
2022-11-09 22:08:44 +00:00
|
|
|
{{- toYaml . | nindent 8 }}
|
2022-10-24 17:24:21 +00:00
|
|
|
{{- end }}
|
2022-07-26 18:19:29 +00:00
|
|
|
terminationGracePeriodSeconds: 60
|
2022-11-09 22:08:44 +00:00
|
|
|
{{- 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 }}
|
2023-01-30 02:02:55 +00:00
|
|
|
{{- with .Values.coder.initContainers }}
|
|
|
|
initContainers:
|
|
|
|
{{ toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2022-07-26 18:19:29 +00:00
|
|
|
containers:
|
|
|
|
- name: coder
|
2022-09-02 11:01:30 +00:00
|
|
|
image: {{ include "coder.image" . | quote }}
|
2022-07-26 18:19:29 +00:00
|
|
|
imagePullPolicy: {{ .Values.coder.image.pullPolicy }}
|
2023-05-04 21:07:49 +00:00
|
|
|
command:
|
|
|
|
- /opt/coder
|
|
|
|
args:
|
|
|
|
{{- if .Values.coder.workspaceProxy }}
|
2023-05-11 17:55:04 +00:00
|
|
|
- wsproxy
|
2023-05-04 21:07:49 +00:00
|
|
|
{{- end }}
|
|
|
|
- server
|
2022-07-26 18:19:29 +00:00
|
|
|
resources:
|
2022-10-21 15:07:05 +00:00
|
|
|
{{- toYaml .Values.coder.resources | nindent 12 }}
|
2023-03-17 00:55:24 +00:00
|
|
|
lifecycle:
|
|
|
|
{{- toYaml .Values.coder.lifecycle | nindent 12 }}
|
2022-07-26 18:19:29 +00:00
|
|
|
env:
|
2022-12-15 20:09:19 +00:00
|
|
|
- name: CODER_HTTP_ADDRESS
|
|
|
|
value: "0.0.0.0:8080"
|
|
|
|
- name: CODER_PROMETHEUS_ADDRESS
|
2023-01-10 16:16:56 +00:00
|
|
|
value: "0.0.0.0:2112"
|
2022-11-13 20:49:57 +00:00
|
|
|
# Set the default access URL so a `helm apply` works by default.
|
|
|
|
# See: https://github.com/coder/coder/issues/5024
|
|
|
|
{{- $hasAccessURL := false }}
|
|
|
|
{{- range .Values.coder.env }}
|
|
|
|
{{- if eq .name "CODER_ACCESS_URL" }}
|
|
|
|
{{- $hasAccessURL = true }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if not $hasAccessURL }}
|
|
|
|
- name: CODER_ACCESS_URL
|
2022-12-15 20:09:19 +00:00
|
|
|
value: {{ include "coder.defaultAccessURL" . | quote }}
|
2022-11-13 20:49:57 +00:00
|
|
|
{{- end }}
|
2022-10-17 13:43:30 +00:00
|
|
|
# Used for inter-pod communication with high-availability.
|
|
|
|
- name: KUBE_POD_IP
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: status.podIP
|
2022-10-17 19:27:38 +00:00
|
|
|
- name: CODER_DERP_SERVER_RELAY_URL
|
2022-12-15 20:09:19 +00:00
|
|
|
value: "http://$(KUBE_POD_IP):8080"
|
2022-10-04 11:45:21 +00:00
|
|
|
{{- include "coder.tlsEnv" . | nindent 12 }}
|
2022-07-26 18:19:29 +00:00
|
|
|
{{- with .Values.coder.env -}}
|
|
|
|
{{ toYaml . | nindent 12 }}
|
|
|
|
{{- end }}
|
|
|
|
ports:
|
2022-12-15 20:09:19 +00:00
|
|
|
- name: "http"
|
|
|
|
containerPort: 8080
|
2022-07-26 18:19:29 +00:00
|
|
|
protocol: TCP
|
2022-12-15 20:09:19 +00:00
|
|
|
{{- if eq (include "coder.tlsEnabled" .) "true" }}
|
|
|
|
- name: "https"
|
|
|
|
containerPort: 8443
|
|
|
|
protocol: TCP
|
|
|
|
{{- end }}
|
2022-12-01 15:43:32 +00:00
|
|
|
{{- range .Values.coder.env }}
|
2022-12-18 18:48:08 +00:00
|
|
|
{{- if eq .name "CODER_PROMETHEUS_ENABLE" }}
|
|
|
|
{{/*
|
|
|
|
This sadly has to be nested to avoid evaluating the second part
|
|
|
|
of the condition too early and potentially getting type errors if
|
|
|
|
the value is not a string (like a `valueFrom`). We do not support
|
|
|
|
`valueFrom` for this env var specifically.
|
|
|
|
*/}}
|
|
|
|
{{- if eq .value "true" }}
|
2022-12-01 15:43:32 +00:00
|
|
|
- name: "prometheus-http"
|
2023-01-10 16:16:56 +00:00
|
|
|
containerPort: 2112
|
2022-12-01 15:43:32 +00:00
|
|
|
protocol: TCP
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2022-12-18 18:48:08 +00:00
|
|
|
{{- end }}
|
2023-02-09 18:26:35 +00:00
|
|
|
securityContext: {{ toYaml .Values.coder.securityContext | nindent 12 }}
|
2022-07-26 18:19:29 +00:00
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /api/v2/buildinfo
|
2022-12-15 20:09:19 +00:00
|
|
|
port: "http"
|
|
|
|
scheme: "HTTP"
|
2022-07-26 18:19:29 +00:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /api/v2/buildinfo
|
2022-12-15 20:09:19 +00:00
|
|
|
port: "http"
|
|
|
|
scheme: "HTTP"
|
2022-10-04 11:45:21 +00:00
|
|
|
{{- include "coder.volumeMounts" . | nindent 10 }}
|
2022-08-27 15:03:10 +00:00
|
|
|
|
2022-10-04 11:45:21 +00:00
|
|
|
{{- include "coder.volumes" . | nindent 6 }}
|