@@ -198,6 +198,8 @@ Your organization may require connecting to the database instance over SSL. To
198
198
supply Coder with the appropriate certificates, and have it connect over SSL,
199
199
follow the steps below :
200
200
201
+ # ## Client verification (server verifies the client)
202
+
201
203
1. Create the certificate as a secret in your Kubernetes cluster, if not already
202
204
present :
203
205
@@ -222,7 +224,36 @@ coder:
222
224
1. Lastly, your PG connection URL will look like :
223
225
224
226
` ` ` shell
225
- postgres://<user>:<password>@databasehost:<port>/<db-name>?sslmode=require&sslcert=$HOME/.postgresql/postgres.crt&sslkey=$HOME/.postgresql/postgres.key"
227
+ postgres://<user>:<password>@databasehost:<port>/<db-name>?sslmode=require&sslcert="$HOME/.postgresql/postgres.crt&sslkey=$HOME/.postgresql/postgres.key"
228
+ ` ` `
229
+
230
+ # ## Server verification (client verifies the server)
231
+
232
+ 1. Download the CA certificate chain for your database instance, and create it
233
+ as a secret in your Kubernetes cluster, if not already present :
234
+
235
+ ` ` ` shell
236
+ kubectl create secret tls postgres-certs -n coder --key="postgres-root.key" --cert="postgres-root.crt"
237
+ ` ` `
238
+
239
+ 1. Define the secret volume and volumeMounts in the Helm chart :
240
+
241
+ ` ` ` yaml
242
+ coder:
243
+ volumes:
244
+ - name: "pg-certs-mount"
245
+ secret:
246
+ secretName: "postgres-certs"
247
+ volumeMounts:
248
+ - name: "pg-certs-mount"
249
+ mountPath: "$HOME/.postgresql/postgres-root.crt"
250
+ readOnly: true
251
+ ` ` `
252
+
253
+ 1. Lastly, your PG connection URL will look like :
254
+
255
+ ` ` ` shell
256
+ postgres://<user>:<password>@databasehost:<port>/<db-name>?sslmode=verify-full&sslrootcert="/home/coder/.postgresql/postgres-root.crt"
226
257
` ` `
227
258
228
259
> More information on connecting to PostgreSQL databases using certificates can
0 commit comments