Skip to content

Commit 8b7193f

Browse files
author
Simon Emms
committed
[installer]: document the custom annotations
1 parent b21e31a commit 8b7193f

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

install/installer/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,93 @@ defined in the spec and so will be deleted shortly after the jobs have run.
142142

143143
# Advanced topics
144144

145+
## Custom Annotations, Environment Variables and Labels
146+
147+
There are times when it is desirable for custom annotations, environment
148+
variables and labels should be added to an installation.
149+
150+
### Installer Config
151+
152+
This can be added to the root of the `gitpod.config.yaml`. If nothing is passed in,
153+
no custom parameters are added in.
154+
155+
The structure is based upon the standard Kubernetes resource definition. For annotations
156+
and labels, these must match the `apiVersion`, the `kind` and the `metadata.name` - a
157+
wildcard `*` can be used to match all resources. For environment variables, the
158+
`apiVersion` and `kind` are ignored, as these are only implemented on containers. As
159+
before, the `*` wildcard can be used on `metadata.name`.
160+
161+
```yaml
162+
customization:
163+
- apiVersion: "*"
164+
kind: "*"
165+
metadata:
166+
name: "*"
167+
annotations:
168+
appliedToAll: value
169+
hello: world
170+
labels:
171+
appliedToAll: value
172+
hello: world
173+
- apiVersion: "apps/v1"
174+
kind: "Deployment"
175+
metadata:
176+
name: "ws-manager"
177+
annotations:
178+
hello: ws-manager
179+
labels:
180+
hello: ws-manager
181+
spec:
182+
env:
183+
- name: HELLO
184+
value: world
185+
```
186+
187+
This example would generate the following spec (these are simplified for readability reasons):
188+
189+
```yaml
190+
---
191+
# apps/v1/DaemonSet ws-daemon
192+
apiVersion: apps/v1
193+
kind: DaemonSet
194+
metadata:
195+
labels:
196+
app: gitpod # system-value
197+
component: ws-daemon # system-value
198+
appliedToAll: value
199+
hello: world
200+
annotations:
201+
appliedToAll: value
202+
hello: world
203+
name: ws-daemon
204+
---
205+
# apps/v1/Deployment ws-manager
206+
apiVersion: apps/v1
207+
kind: Deployment
208+
metadata:
209+
creationTimestamp: null
210+
labels:
211+
app: gitpod
212+
component: ws-manager
213+
appliedToAll: value
214+
hello: ws-manager
215+
annotations:
216+
appliedToAll: value
217+
hello: ws-manager
218+
name: ws-manager
219+
spec:
220+
template:
221+
spec:
222+
containers:
223+
- env:
224+
- name: HELLO
225+
value: world
226+
```
227+
228+
In the event of multiple matches, the final matching customization would be applied. For
229+
that reason, it is a good idea to structure your customization from least to most specific.
230+
System-generated values will never be overridden.
231+
145232
## Post-processing the YAML
146233
147234
> Here be dragons.

0 commit comments

Comments
 (0)