From 5394453fb0592f57d1476a248f5dac54f63a9d89 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Sat, 12 Nov 2022 19:13:23 +0000 Subject: [PATCH 1/2] fix: Set a default `CODER_ACCESS_URL` in Helm This allows for a simple `helm apply` to create a full Coder deployment that works for creating workspaces. --- helm/templates/coder.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/helm/templates/coder.yaml b/helm/templates/coder.yaml index 3ac36089c4821..9e3b26e1ac85a 100644 --- a/helm/templates/coder.yaml +++ b/helm/templates/coder.yaml @@ -54,6 +54,18 @@ spec: env: - name: CODER_ADDRESS value: "0.0.0.0:{{ include "coder.port" . }}" + # 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 + value: "{{ include "coder.portName" . }}://coder.{{.Release.Namespace}}.svc.cluster.local" + {{- end }} # Used for inter-pod communication with high-availability. - name: KUBE_POD_IP valueFrom: From 9ff74e2dc7513491705ec7b51a9dedcb14217d6c Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Sun, 13 Nov 2022 20:09:20 +0000 Subject: [PATCH 2/2] Update docs --- docs/install/kubernetes.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/install/kubernetes.md b/docs/install/kubernetes.md index aac31ae8099e0..3c756917c0c6e 100644 --- a/docs/install/kubernetes.md +++ b/docs/install/kubernetes.md @@ -87,8 +87,6 @@ to log in and manage templates. # `CODER_TLS_ENABLE`, `CODER_TLS_CERT_FILE` or `CODER_TLS_KEY_FILE` as # they are already set by the Helm chart and will cause conflicts. env: - - name: CODER_ACCESS_URL - value: "https://coder.example.com" - name: CODER_PG_CONNECTION_URL valueFrom: secretKeyRef: @@ -98,6 +96,11 @@ to log in and manage templates. name: coder-db-url key: url + # (Optional) For production deployments the access URL should be set. + # If you're just trying Coder, access the dashboard via the service IP. + - name: CODER_ACCESS_URL + value: "https://coder.example.com" + # This env variable controls whether or not to auto-import the # "kubernetes" template on first startup. This will not work unless # coder.serviceAccount.workspacePerms is true.