@@ -40,8 +40,10 @@ The provisioner daemon must authenticate with your Coder deployment.
40
40
41
41
## Scoped Key (Recommended)
42
42
43
- We recommend creating finely-scoped keys for provisioners. Keys are scoped to an
44
- organization.
43
+ We recommend creating finely-scoped keys for provisioners.
44
+ Keys are scoped to an organization, and optionally to a specific set of tags.
45
+
46
+ To create a key for an organization that will match untagged jobs:
45
47
46
48
``` sh
47
49
coder provisioner keys create my-key \
@@ -52,7 +54,7 @@ Successfully created provisioner key my-key! Save this authentication token, it
52
54
< key omitted>
53
55
```
54
56
55
- Or, restrict the provisioner to jobs with specific tags
57
+ To restrict the provisioner to jobs with specific tags:
56
58
57
59
``` sh
58
60
coder provisioner keys create kubernetes-key \
@@ -64,7 +66,7 @@ Successfully created provisioner key kubernetes-key! Save this authentication to
64
66
< key omitted>
65
67
```
66
68
67
- To start the provisioner:
69
+ You can then start the provisioner with the specified key :
68
70
69
71
``` sh
70
72
export CODER_URL=https://< your-coder-url>
@@ -98,11 +100,12 @@ Note: Any user can start [user-scoped provisioners](#user-scoped-provisioners),
98
100
but this will also require a template on your deployment with the corresponding
99
101
tags.
100
102
101
- ## Global PSK
103
+ ## Global PSK (Not Recommended)
104
+
105
+ > [ !NOTE] We do not recommend this approach anymore, as it makes
106
+ > key rotation or isolating provisioners far more difficult.
102
107
103
- A deployment-wide PSK can be used to authenticate any provisioner. We do not
104
- recommend this approach anymore, as it makes key rotation or isolating
105
- provisioners far more difficult. To use a global PSK, set a
108
+ A deployment-wide PSK can be used to authenticate any provisioner. To use a global PSK, set a
106
109
[ provisioner daemon pre-shared key (PSK)] ( ../reference/cli/server.md#--provisioner-daemon-psk )
107
110
on the Coder server.
108
111
@@ -275,18 +278,31 @@ coder templates push on-prem \
275
278
Coder provides a Helm chart for running external provisioner daemons, which you
276
279
will use in concert with the Helm chart for deploying the Coder server.
277
280
278
- 1 . Create a long, random pre-shared key (PSK) and store it in a Kubernetes
279
- secret
281
+ 1 . Create a provisioner key:
282
+
283
+ ``` sh
284
+ coder provisioner keys create my-cool-key --org default
285
+ # Optionally, you can specify tags for the provsioner key:
286
+ # coder provisioner keys create my-cool-key --org default --tags location=auh kind=k8s
287
+ ```
288
+
289
+ Successfully created provisioner key kubernetes-key! Save this authentication token, it will not be shown again.
290
+
291
+ <key omitted >
292
+ ```
293
+
294
+ Store the key in a kubernetes secret:
280
295
281
296
```sh
282
- kubectl create secret generic coder-provisioner-psk --from-literal=psk= ` head /dev/urandom | base64 | tr -dc A-Za-z0-9 | head -c 26 `
297
+ kubectl create secret generic coder-provisioner-psk --from-literal=key1=`<key omitted> `
283
298
```
284
299
285
300
1 . Modify your Coder ` values.yaml ` to include
286
301
287
302
``` yaml
288
303
provisionerDaemon :
289
- pskSecretName : " coder-provisioner-psk"
304
+ keySecretName : " coder-provisioner-keys"
305
+ keySecretKey : " key1"
290
306
` ` `
291
307
292
308
1. Redeploy Coder with the new ` values.yaml` to roll out the PSK. You can omit
@@ -300,7 +316,7 @@ will use in concert with the Helm chart for deploying the Coder server.
300
316
` ` `
301
317
302
318
1. Create a `provisioner-values.yaml` file for the provisioner daemons Helm
303
- chart. For example
319
+ chart. For example :
304
320
305
321
` ` ` yaml
306
322
coder:
@@ -309,10 +325,8 @@ will use in concert with the Helm chart for deploying the Coder server.
309
325
value: "https://coder.example.com"
310
326
replicaCount: 10
311
327
provisionerDaemon:
312
- pskSecretName: "coder-provisioner-psk"
313
- tags:
314
- location: auh
315
- kind: k8s
328
+ keySecretName: "coder-provisioner-keys"
329
+ keySecretKey: "key1"
316
330
` ` `
317
331
318
332
This example creates a deployment of 10 provisioner daemons (for 10
0 commit comments