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. 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: