Skip to content

Commit 01e0e27

Browse files
committed
Document how to specify additional labels/annotations for deployment
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
1 parent 9420d6b commit 01e0e27

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/additional-configuration.md

+18
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,24 @@ data:
122122

123123
Note: As for automatically mounting secrets, it is necessary to apply the `controller.devfile.io/watch-secret` label to git credentials secrets
124124

125+
## Applying labels and annotations to the workspace deployment
126+
In some cases, it is useful to apply additional labels or annotations to the deployment that is created for a DevWorkspace. This is supported by setting attributes `controller.devfile.io/deployment-labels` and `controller.devfile.io/deployment-annotations` in the DevWorkspace's attributes field. The value of these attributes should be specified as a string map, as it is for regular metadata labels and annotations. For example:
127+
```
128+
kind: DevWorkspace
129+
apiVersion: workspace.devfile.io/v1alpha2
130+
metadata:
131+
name: my-workspace
132+
spec:
133+
template:
134+
attributes:
135+
controller.devfile.io/deployment-labels:
136+
my-label: foo
137+
my-other-label: bar
138+
controller.devfile.io/deployment-annotations:
139+
my-attribute: foo
140+
my-other-attribute: bar
141+
```
142+
125143
## Debugging a failing workspace
126144
Normally, when a workspace fails to start, the deployment will be scaled down and the workspace will be stopped in a `Failed` state. This can make it difficult to debug misconfiguration errors, so the annotation `controller.devfile.io/debug-start: "true"` can be applied to DevWorkspaces to leave resources for failed workspaces on the cluster. This allows viewing logs from workspace containers.
127145

0 commit comments

Comments
 (0)