@@ -9,163 +9,149 @@ You can deploy Coder on Rancher as a
9
9
- Helm 3.5+ installed
10
10
- Workload Kubernetes cluster for Coder
11
11
12
- ##Install Coder with SUSE Rancher Manager
12
+ ##Overview
13
13
14
- 1 . Create a namespace for the Codercontrol plane. In this tutorial, we call it ` coder ` :
14
+ Installing Coderon Rancher involves four key steps :
15
15
16
- ``` shell
17
- kubectl create namespace coder
18
- ```
16
+ 1 . Create a namespace for Coder
17
+ 1 . Set up PostgreSQL
18
+ 1 . Create a database connection secret
19
+ 1 . Install the Coder application via Rancher UI
19
20
20
- 1 . Create aPostgreSQL instance:
21
+ ## Create anamespace
21
22
22
- < div class = " tabs " >
23
+ Create a namespace for the Coder control plane. In this tutorial, we call it ` coder ` :
23
24
24
- Coder does not manage a database server for you. This is required for storing
25
- data about your Coder deployment and resources.
25
+ ``` shell
26
+ kubectl create namespace coder
27
+ ```
26
28
27
- ### Managed PostgreSQL (recommended)
29
+ ## Set up PostgreSQL
28
30
29
- If you're in a public cloud such as
30
- [ Google Cloud] ( https://cloud.google.com/sql/docs/postgres/ ) ,
31
- [ AWS] ( https://aws.amazon.com/rds/postgresql/ ) ,
32
- [ Azure] ( https://docs.microsoft.com/en-us/azure/postgresql/ ) , or
33
- [ DigitalOcean] ( https://www.digitalocean.com/products/managed-databases-postgresql ) ,
34
- you can use the managed PostgreSQL offerings they provide. Make sure that the
35
- PostgreSQL service is running and accessible from your cluster. It should be in
36
- the same network, same project, etc.
31
+ Coder requires a PostgreSQL database to store deployment data.
32
+ We recommend that you use a managed PostgreSQL service, but you can use an in-cluster PostgreSQL service for non-production deployments:
37
33
38
- ### In-Cluster PostgreSQL (for proof of concepts)
34
+ < div class = " tabs " >
39
35
40
- You can install Postgres manually on your cluster using the
41
- [ Bitnami PostgreSQL Helm chart] ( https://github.com/bitnami/charts/tree/master/bitnami/postgresql#readme ) .
42
- There are some[ helpful guides] ( https://phoenixnap.com/kb/postgresql-kubernetes )
43
- on the internet that explain sensible configurations for this chart.
36
+ ###Managed PostgreSQL (Recommended)
44
37
45
- Here's one example :
38
+ For production deployments, we recommend using a managed PostgreSQL service :
46
39
47
- ``` console
48
- # Install PostgreSQL
49
- helm repo add bitnami https://charts.bitnami.com/bitnami
50
- helm install coder-db bitnami/postgresql \
51
- --namespace coder \
52
- --set auth.username=coder \
53
- --set auth.password=coder \
54
- --set auth.database=coder \
55
- --set persistence.size=10Gi
56
- ```
40
+ - [ Google Cloud SQL] ( https://cloud.google.com/sql/docs/postgres/ )
41
+ - [ AWS RDS for PostgreSQL] ( https://aws.amazon.com/rds/postgresql/ )
42
+ - [ Azure Database for PostgreSQL] ( https://docs.microsoft.com/en-us/azure/postgresql/ )
43
+ - [ DigitalOcean Managed PostgreSQL] ( https://www.digitalocean.com/products/managed-databases-postgresql )
57
44
58
- The cluster-internal DB URL for the above database is :
45
+ Ensure that your PostgreSQL service :
59
46
60
- ``` shell
61
- postgres://coder:coder@coder-db-postgresql.coder.svc. cluster.local:5432/coder ? sslmode=disable
62
- ```
47
+ - Is running and accessible from your cluster
48
+ - Is in the same network/project as your cluster
49
+ - Has proper credentials and a database created for Coder
63
50
64
- Optionally, you can use the
65
- [ Postgres operator] ( https://github.com/zalando/postgres-operator ) to manage
66
- PostgreSQL deployments on your Kubernetes cluster.
51
+ ###In-Cluster PostgreSQL (Development/PoC)
67
52
68
- </ div >
53
+ For proof-of-concept deployments, you can use Bitnami Helm chart to install PostgreSQL in your Kubernetes cluster:
69
54
70
- 1 . Create the PostgreSQL secret.
55
+ ``` console
56
+ helm repo add bitnami https://charts.bitnami.com/bitnami
57
+ helm install coder-db bitnami/postgresql \
58
+ --namespace coder \
59
+ --set auth.username=coder \
60
+ --set auth.password=coder \
61
+ --set auth.database=coder \
62
+ --set persistence.size=10Gi
63
+ ```
71
64
72
- Create a secret with the PostgreSQL database URL string. In the case of the
73
- self-managed PostgreSQL, the address will be:
65
+ After installation, the cluster-internal database URL will be:
74
66
75
- ``` shell
76
- kubectl create secret generic coder-db-url -n coder \
77
- --from-literal=url=" postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable"
78
- ```
67
+ ``` text
68
+ postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable
69
+ ```
70
+
71
+ For more advanced PostgreSQL management, consider using the
72
+ [ Postgres operator] ( https://github.com/zalando/postgres-operator ) .
73
+
74
+ </div >
75
+
76
+ ##Create the database connection secret
79
77
80
- 1 . Select the target workload K8s cluster for Coder in the Rancher Manager console and access the Kubectl shell.
78
+ Create a Kubernetes secret with your PostgreSQL connection URL:
81
79
82
- 1 . From the** Cluster Manager** console, go to** Apps** >** Charts**
80
+ ``` shell
81
+ kubectl create secret generic coder-db-url -n coder \
82
+ --from-literal=url=" postgres://coder:coder@coder-db-postgresql.coder.svc.cluster.local:5432/coder?sslmode=disable"
83
+ ```
83
84
84
- 1 . Select** Partners** from the drop-down menu and search for` Coder ` .
85
+ > [ !Important]
86
+ > If you're using a managed PostgreSQL service, replace the connection URL with your specific database credentials.
85
87
86
- 1 . Select ** Coder** , then ** Install ** .
88
+ ## Install Coder through the Rancher UI
87
89
88
- 1 . Select thetarget namespace you created for Coder and select** Customize Helm options before install ** , then ** Next ** .
90
+ 1 . In theRancher Manager console, selectyour target Kubernetes cluster for Coder .
89
91
90
- 1 . Configure Values used by Helm that help define the Coder App.
92
+ 1 . Navigate to ** Apps ** > ** Charts **
91
93
92
- Select ** Edit YAML ** andenter configuration settings foryour deployment.
94
+ 1 . From the dropdown menu, select ** Partners ** andsearch for` Coder `
93
95
94
- < details >< summary >Expand for an example `values.yaml`</ summary >
96
+ 1 . Select ** Coder ** , then ** Install **
95
97
96
- <!-- from kubernetes.md-->
98
+ 1 . Select the` coder ` namespace you created earlier and check** Customize Helm options before install** .
99
+
100
+ Select** Next**
101
+
102
+ 1 . On the configuration screen, select** Edit YAML** and enter your Coder configuration settings:
103
+
104
+ <details >
105
+ <summary >Example values.yaml configuration</summary >
97
106
98
107
``` yaml
99
108
coder :
100
- # You can specify any environment variables you'd like to pass to Coder
101
- # here. Coder consumes environment variables listed in
102
- # `coder server --help`, and these environment variables are also passed
103
- # to the workspace provisioner (so you can consume them in your Terraform
104
- # templates for auth keys etc.).
105
- #
106
- # Please keep in mind that you should not set `CODER_HTTP_ADDRESS`,
107
- # `CODER_TLS_ENABLE`, `CODER_TLS_CERT_FILE` or `CODER_TLS_KEY_FILE` as
108
- # they are already set by the Helm chart and will cause conflicts.
109
+ # Environment variables for Coder
109
110
env :
110
111
-name :CODER_PG_CONNECTION_URL
111
112
valueFrom :
112
113
secretKeyRef :
113
- # You'll need to create a secret called coder-db-url with your
114
- # Postgres connection URL like:
115
- # postgres://coder:password@postgres:5432/coder?sslmode=disable
116
114
name :coder-db-url
117
115
key :url
118
116
119
- # (Optional) For production deployments the access URL should be set.
120
- # If you're just trying Coder, access the dashboard via the service IP.
117
+ # For production, uncomment and set your access URL
121
118
# - name: CODER_ACCESS_URL
122
119
# value: "https://coder.example.com"
123
120
121
+ # For TLS configuration (uncomment if needed)
124
122
# tls:
125
123
# secretNames:
126
124
# - my-tls-secret-name
127
125
```
128
126
129
- > You can view our
130
- > [ Helm README] ( https://github.com/coder/coder/blob/main/helm#readme ) for
131
- > details on the values that are available, or you can view the
132
- > [ values.yaml] ( https://github.com/coder/coder/blob/main/helm/coder/values.yaml )
133
- > file directly.
127
+ For available configuration options, refer to the[ Helm chart documentation] ( https://github.com/coder/coder/blob/main/helm#readme )
128
+ or[ values.yaml file] ( https://github.com/coder/coder/blob/main/helm/coder/values.yaml ) .
134
129
135
- We support two release channels: mainline and stable - read the
136
- [ Releases] ( ./releases.md ) page to learn more about which best suits your team.
137
-
138
- - ** Mainline** Coder release:
130
+ </details >
139
131
140
- <!-- autoversion(mainline): "-- version [version]" -->
132
+ 1 . Select a Coder version:
141
133
142
- ``` shell
143
- helm install coder coder-v2/coder \
144
- --namespace coder \
145
- --values values.yaml \
146
- --version 2.19.0
147
- ```
134
+ - ** Mainline** :` 2.20.x `
135
+ - ** Stable** :` 2.19.x `
148
136
149
- - ** Stable ** Coder release:
137
+ Learn more about release channels in the [ Releases documentation ] ( ./releases.md ) .
150
138
151
- < ! -- autoversion(stable): " --version [version] " -- >
139
+ 1 . Select ** Next ** when your configuration is complete.
152
140
153
- ` ` ` shell
154
- helm install coder coder-v2/coder \
155
- --namespace coder \
156
- --values values.yaml \
157
- --version 2.18.5
158
- ` ` `
141
+ 1 . On the** Supply additional deployment options** screen:
159
142
160
- < /details>
143
+ 1 . Accept the default settings
144
+ 1 . Select** Install**
161
145
162
- Select ** Next ** when you ' re done .
146
+ 1 . A Helm install output shell will be displayed and indicates the installation status .
163
147
164
- 1. On the **Supply additional deployment options** screen, accept the default settings, then select **Install**.
148
+ ## Manage your Rancher Coder deployment
165
149
166
- A Helm install output shell will be displayed and should indicate success when completed.
150
+ To update or manage your Coder deployment later:
167
151
168
- In the future, if you need to update a Coder deployment, select Coder from **Installed Apps** and use the options in the **⋮** menu.
152
+ 1 . Navigate to** Apps** >** Installed Apps** in the Rancher UI.
153
+ 1 . Find and select Coder.
154
+ 1 . Use the options in the** ⋮** menu for upgrade, rollback, or other operations.
169
155
170
156
##Next steps
171
157