You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(helm/provisioner): support deploying multiple provisioners in same namespace (coder#15637)
Fixescoder#15437
- Adds support for `coder.serviceAccount.disableCreate` (originally
added to `helm/coder` in coder#14817).
- Adds documentation and examples in `helm/provisioner/README.md` on
deploying multiple provisioners in the same namespace leveraging
`nameOverride`.
Copy file name to clipboardExpand all lines: helm/provisioner/README.md
+114-1Lines changed: 114 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,5 +32,118 @@ coder:
32
32
value: "0.0.0.0:2112"
33
33
replicaCount: 10
34
34
provisionerDaemon:
35
-
pskSecretName: "coder-provisioner-psk"
35
+
keySecretName: "coder-provisionerd-key"
36
+
keySecretKey: "provisionerd-key"
36
37
```
38
+
39
+
## Specific Examples
40
+
41
+
Below are some common specific use-cases when deploying a Coder provisioner.
42
+
43
+
### Set Labels and Annotations
44
+
45
+
If you need to set deployment- or pod-level labels and annotations, set `coder.{annotations,labels}` or `coder.{podAnnotations,podLabels}`.
46
+
47
+
Example:
48
+
49
+
```yaml
50
+
coder:
51
+
# ...
52
+
annotations:
53
+
com.coder/annotation/foo: bar
54
+
com.coder/annotation/baz: qux
55
+
labels:
56
+
com.coder/label/foo: bar
57
+
com.coder/label/baz: qux
58
+
podAnnotations:
59
+
com.coder/podAnnotation/foo: bar
60
+
com.coder/podAnnotation/baz: qux
61
+
podLabels:
62
+
com.coder/podLabel/foo: bar
63
+
com.coder/podLabel/baz: qux
64
+
```
65
+
66
+
### Additional Templates
67
+
68
+
You can include extra Kubernetes manifests in `extraTemplates`.
69
+
70
+
The below example will also create a `ConfigMap` along with the Helm release:
71
+
72
+
```yaml
73
+
coder:
74
+
# ...
75
+
provisionerDaemon:
76
+
# ...
77
+
extraTemplates:
78
+
- |
79
+
apiVersion: v1
80
+
kind: ConfigMap
81
+
metadata:
82
+
name: some-config
83
+
namespace: {{ .Release.Namespace }}
84
+
data:
85
+
key: some-value
86
+
```
87
+
88
+
### Disable Service Account Creation
89
+
90
+
### Deploying multiple provisioners in the same namespace
91
+
92
+
To deploy multiple provisioners in the same namespace, set the following values explicitly to avoid conflicts:
93
+
94
+
- `nameOverride`: controls the name of the provisioner deployment
95
+
- `serviceAccount.name`: controls the name of the service account.
96
+
97
+
Note that `nameOverride` does not apply to `extraTemplates`, as illustrated below:
98
+
99
+
```yaml
100
+
coder:
101
+
# ...
102
+
serviceAccount:
103
+
name: other-coder-provisioner
104
+
provisionerDaemon:
105
+
# ...
106
+
nameOverride: "other-coder-provisioner"
107
+
extraTemplates:
108
+
- |
109
+
apiVersion: v1
110
+
kind: ConfigMap
111
+
metadata:
112
+
name: some-other-config
113
+
namespace: {{ .Release.Namespace }}
114
+
data:
115
+
key: some-other-value
116
+
```
117
+
118
+
If you wish to deploy a second provisioner that references an existing service account, you can do so as follows:
119
+
120
+
- Set `coder.serviceAccount.disableCreate=true` to disable service account creation,
121
+
- Set `coder.serviceAccount.workspacePerms=false` to disable creation of a role and role binding,
122
+
- Set `coder.serviceAccount.nameOverride` to the name of an existing service account.
123
+
124
+
See below for a concrete example:
125
+
126
+
```yaml
127
+
coder:
128
+
# ...
129
+
serviceAccount:
130
+
name: preexisting-service-account
131
+
disableCreate: true
132
+
workspacePerms: false
133
+
provisionerDaemon:
134
+
# ...
135
+
nameOverride: "other-coder-provisioner"
136
+
```
137
+
138
+
# Testing
139
+
140
+
The test suite for this chart lives in `./tests/chart_test.go`.
141
+
142
+
Each test case runs `helm template` against the corresponding `test_case.yaml`, and compares the output with that of the corresponding `test_case.golden` in `./tests/testdata`.
143
+
If `expectedError` is not empty for that specific test case, no corresponding `.golden` file is required.
144
+
145
+
To add a new test case:
146
+
147
+
- Create an appropriately named `.yaml` file in `testdata/` along with a corresponding `.golden` file, if required.
148
+
- Add the test case to the array in `chart_test.go`, setting `name` to the name of the files you added previously (without the extension). If appropriate, set `expectedError`.
149
+
- Run the tests and ensure that no regressions in existing test cases occur: `go test ./tests`.
0 commit comments