@@ -103,6 +103,131 @@ grep /etc/group -e "docker"
103103sudo systemctl restart coder.service
104104` ` `
105105
106+ # # Kubernetes via Helm
107+
108+ Before proceeding, please ensure that you have both Helm 3.5+ and the
109+ [latest version of Coder](https://github.com/coder/coder/releases) installed.
110+ You will also need to have a Kubernetes cluster running K8s 1.19+.
111+
112+ > See our [Helm README](https://github.com/coder/coder/blob/main/helm#readme)
113+ > file for additional information. Check the
114+ > [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml) file
115+ > for a list of supported Helm values and their defaults.
116+
117+ > ⚠️ ** Warning** : Helm support is new and not yet complete. There may be changes
118+ > to the Helm chart between releases which require manual values updates. Please
119+ > file an issue if you run into any issues.
120+ >
121+ > Additionally, the Helm chart does not currently automatically configure a
122+ > Service Account and workspace template for use in Coder. See
123+ > [# 3265](https://github.com/coder/coder/issues/3265).
124+
125+ 1. Create a namespace for Coder, such as ` coder` :
126+
127+ ` ` ` console
128+ $ kubectl create namespace coder
129+ ` ` `
130+
131+ 1. Create a PostgreSQL deployment. Coder does not manage a database server for
132+ you.
133+
134+ - If you' re in a public cloud such as
135+ [Google Cloud](https://cloud.google.com/sql/docs/postgres/),
136+ [AWS](https://aws.amazon.com/rds/postgresql/),
137+ [Azure](https://docs.microsoft.com/en-us/azure/postgresql/), or
138+ [DigitalOcean](https://www.digitalocean.com/products/managed-databases-postgresql),
139+ you can use the managed PostgreSQL offerings they provide. Make sure that
140+ the PostgreSQL service is running and accessible from your cluster. It
141+ should be in the same network, same project, etc.
142+
143+ - You can install Postgres manually on your cluster using the
144+ [Bitnami PostgreSQL Helm chart](https://github.com/bitnami/charts/tree/master/bitnami/postgresql#readme). There are some
145+ [helpful guides](https://phoenixnap.com/kb/postgresql-kubernetes) on the
146+ internet that explain sensible configurations for this chart. Example:
147+
148+ ```console
149+ $ helm repo add bitnami https://charts.bitnami.com/bitnami
150+ $ helm install postgres bitnami/postgresql \
151+ --namespace coder \
152+ --set auth.username=coder \
153+ --set auth.password=coder \
154+ --set auth.database=coder \
155+ --set persistence.size=10Gi
156+ ```
157+
158+ The cluster-internal DB URL for the above database is:
159+ ```
160+ postgres://coder:[email protected] :5432/coder?sslmode=disable 161+ ```
162+
163+ > Ensure you set up periodic backups so you don' t lose data.
164+
165+ - You can use
166+ [Postgres operator](https://github.com/zalando/postgres-operator) to
167+ manage PostgreSQL deployments on your Kubernetes cluster.
168+
169+ 1. Download the latest ` coder_helm` package from
170+ [GitHub releases](https://github.com/coder/coder/releases).
171+
172+ 1. Create a ` values.yaml` with the configuration settings you' d like for your
173+ deployment. For example:
174+
175+ ```yaml
176+ coder:
177+ # You can specify any environment variables you' d like to pass to Coder
178+ # here. Coder consumes environment variables listed in
179+ # `coder server --help`, and these environment variables are also passed
180+ # to the workspace provisioner (so you can consume them in your Terraform
181+ # templates for auth keys etc.).
182+ #
183+ # Please keep in mind that you should not set `CODER_ADDRESS`,
184+ # `CODER_TLS_ENABLE`, `CODER_TLS_CERT_FILE` or `CODER_TLS_KEY_FILE` as
185+ # they are already set by the Helm chart and will cause conflicts.
186+ env:
187+ - name: CODER_ACCESS_URL
188+ value: " https://coder.example.com"
189+ - name: CODER_PG_CONNECTION_URL
190+ valueFrom:
191+ secretKeyRef:
192+ # You'll need to create a secret called coder-db-url with your
193+ # Postgres connection URL like:
194+ # postgres://coder:password@postgres:5432/coder?sslmode=disable
195+ name: coder-db-url
196+ key: url
197+
198+ tls:
199+ secretName: my-tls-secret-name
200+ ` ` `
201+
202+ > You can view our
203+ > [Helm README](https://github.com/coder/coder/blob/main/helm#readme) for
204+ > details on the values that are available, or you can view the
205+ > [values.yaml](https://github.com/coder/coder/blob/main/helm/values.yaml)
206+ > file directly.
207+
208+ 1. Run the following commands to install the chart in your cluster.
209+
210+ ` ` ` console
211+ $ helm install coder ./coder_helm_x.y.z.tgz \
212+ --namespace coder \
213+ --values values.yaml
214+ ` ` `
215+
216+ You can watch Coder start up by running ` kubectl get pods` . Once Coder has
217+ started, the ` coder-* ` pods should enter the ` Running` state.
218+
219+ You can view Coder' s logs by getting the pod name from `kubectl get pods` and
220+ then running `kubectl logs <pod name>`. You can also view these logs in your
221+ Cloud' s log management system if you are using managed Kubernetes.
222+
223+ To upgrade Coder in the future, you can run the following command with a new ` coder_helm_x.y.z.tgz` file from GitHub releases:
224+
225+ ` ` ` console
226+ $ helm upgrade coder ./coder_helm_x.y.z.tgz \
227+ --namespace coder \
228+ -f values.yaml
229+ ` ` `
230+
106231# # Manual
107232
108233We publish self-contained .zip and .tar.gz archives in [GitHub releases](https://github.com/coder/coder/releases). The archives bundle ` coder` binary.
0 commit comments