Skip to content

[installer]: document the custom annotations #10841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions install/installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,93 @@ defined in the spec and so will be deleted shortly after the jobs have run.

# Advanced topics

## Custom Annotations, Environment Variables and Labels

There are times when it is desirable for custom annotations, environment
variables and labels should be added to an installation.

### Installer Config

This can be added to the root of the `gitpod.config.yaml`. If nothing is passed in,
no custom parameters are added in.

The structure is based upon the standard Kubernetes resource definition. For annotations
and labels, these must match the `apiVersion`, the `kind` and the `metadata.name` - a
wildcard `*` can be used to match all resources. For environment variables, the
`apiVersion` and `kind` are ignored, as these are only implemented on containers. As
before, the `*` wildcard can be used on `metadata.name`.

```yaml
customization:
- apiVersion: "*"
kind: "*"
metadata:
name: "*"
annotations:
appliedToAll: value
hello: world
labels:
appliedToAll: value
hello: world
- apiVersion: "apps/v1"
kind: "Deployment"
metadata:
name: "ws-manager"
annotations:
hello: ws-manager
labels:
hello: ws-manager
spec:
env:
- name: HELLO
value: world
```

This example would generate the following spec (these are simplified for readability reasons):

```yaml
---
# apps/v1/DaemonSet ws-daemon
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: gitpod # system-value
component: ws-daemon # system-value
appliedToAll: value
hello: world
annotations:
appliedToAll: value
hello: world
name: ws-daemon
---
# apps/v1/Deployment ws-manager
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: gitpod
component: ws-manager
appliedToAll: value
hello: ws-manager
annotations:
appliedToAll: value
hello: ws-manager
name: ws-manager
spec:
template:
spec:
containers:
- env:
- name: HELLO
value: world
```

In the event of multiple matches, the final matching customization would be applied. For
that reason, it is a good idea to structure your customization from least to most specific.
System-generated values will never be overridden.

## Post-processing the YAML

> Here be dragons.
Expand Down