Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2a6fff9

Browse files
authored
fix: Set a default CODER_ACCESS_URL in Helm (#5041)
* 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. * Update docs
1 parent 73f91e4 commit 2a6fff9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

docs/install/kubernetes.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ to log in and manage templates.
8787
# `CODER_TLS_ENABLE`, `CODER_TLS_CERT_FILE` or `CODER_TLS_KEY_FILE` as
8888
# they are already set by the Helm chart and will cause conflicts.
8989
env:
90-
- name: CODER_ACCESS_URL
91-
value: "https://coder.example.com"
9290
- name: CODER_PG_CONNECTION_URL
9391
valueFrom:
9492
secretKeyRef:
@@ -98,6 +96,11 @@ to log in and manage templates.
9896
name: coder-db-url
9997
key: url
10098

99+
# (Optional) For production deployments the access URL should be set.
100+
# If you're just trying Coder, access the dashboard via the service IP.
101+
- name: CODER_ACCESS_URL
102+
value: "https://coder.example.com"
103+
101104
# This env variable controls whether or not to auto-import the
102105
# "kubernetes" template on first startup. This will not work unless
103106
# coder.serviceAccount.workspacePerms is true.

helm/templates/coder.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ spec:
5454
env:
5555
- name: CODER_ADDRESS
5656
value: "0.0.0.0:{{ include "coder.port" . }}"
57+
# Set the default access URL so a `helm apply` works by default.
58+
# See: https://github.com/coder/coder/issues/5024
59+
{{- $hasAccessURL := false }}
60+
{{- range .Values.coder.env }}
61+
{{- if eq .name "CODER_ACCESS_URL" }}
62+
{{- $hasAccessURL = true }}
63+
{{- end }}
64+
{{- end }}
65+
{{- if not $hasAccessURL }}
66+
- name: CODER_ACCESS_URL
67+
value: "{{ include "coder.portName" . }}://coder.{{.Release.Namespace}}.svc.cluster.local"
68+
{{- end }}
5769
# Used for inter-pod communication with high-availability.
5870
- name: KUBE_POD_IP
5971
valueFrom:

0 commit comments

Comments
 (0)