Skip to content

Commit 9dc7a9b

Browse files
committed
docs: add steps for postgres server verification
1 parent 151aaad commit 9dc7a9b

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

docs/install/kubernetes.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ Your organization may require connecting to the database instance over SSL. To
198198
supply Coder with the appropriate certificates, and have it connect over SSL,
199199
follow the steps below:
200200

201+
### Client verification (server verifies the client)
202+
201203
1. Create the certificate as a secret in your Kubernetes cluster, if not already
202204
present:
203205

@@ -222,7 +224,36 @@ coder:
222224
1. Lastly, your PG connection URL will look like:
223225

224226
```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"
226257
```
227258

228259
> More information on connecting to PostgreSQL databases using certificates can

0 commit comments

Comments
 (0)