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
This procedure walks you through the process of using {prod-short}
11
-
to replicate `ConfigMaps`, `Secrets`, `PersistentVolumeClaim` and other {kubernetes} objects from `{prod-namespace}` namespace to numerous user-specific namespaces. The {prod-short} automates the synchronization of important configuration data such as shared credentials, configuration files, and certificates to user namespaces.
10
+
Learn how to use {prod-short}
11
+
to synchronize `ConfigMaps`, `Secrets`, `PersistentVolumeClaim` and other {kubernetes} objects
12
+
from `{prod-namespace}` namespace to numerous user-specific namespaces.
13
+
The {prod-short} automates the synchronization of important configuration data, such as
14
+
shared credentials, configuration files, and certificates to user namespaces.
12
15
13
16
If you make changes to a {kubernetes} resource in an {prod-namespace} namespace,
14
-
{prod-short} will immediately replicate the changes across all users namespaces.
17
+
{prod-short} will immediately synchronize the changes across all users namespaces.
15
18
In reverse, if a {kubernetes} resource is modified in a user namespace,
16
19
{prod-short} will immediately revert the changes.
17
20
18
21
.Procedure
19
22
20
-
. Create the `ConfigMap` below to replicate into every user {orch-namespace}.
21
-
To enhance the configurability, you can customize the `ConfigMap` by adding additional labels and annotations.
22
-
By default, the ConfigMap is automatically mounted into user workspaces.
23
-
If you do not want the ConfigMap to be mounted, explicitly add the following labels to override the behavior:
23
+
. Create the `ConfigMap` below to create and mount it into every workspace.
See the link:https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[Automatically mounting volumes, configmaps, and secrets]
31
-
for other possible labels and annotations.
32
-
+
33
-
.Replicate a ConfigMap into every user {orch-namespace}:
To enhance the configurability, you can customize the `ConfigMap` by adding additional labels and annotations.
41
+
+
42
+
Add the following labels if you do not want the ConfigMap to be mounted automatically:
51
43
+
52
-
.Replicate a ConfigMap into every user {orch-namespace} and automatically mount a `settings.xml` file into every user container by path `/home/user/.m2`:
See the link:https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[Automatically mounting volumes, configmaps, and secrets]
57
+
+
58
+
See the link:https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[mounting volumes, configmaps, and secrets]
88
59
for other possible labels and annotations.
60
+
61
+
62
+
. Create the `Secret` below to create and mount it into every workspace.
89
63
+
90
-
.Replicate a Secret into every user {orch-namespace}:
To enhance the configurability, you can customize the `Secret` by adding additional labels and annotations.
80
+
+
81
+
Add the labels if you do not want the Secret to be mounted automatically:
110
82
+
111
-
.Replicate a Secret into every user {orch-namespace} and automatically mount a `secret.data` file into every user container by path `/home/user/secrets`:
.Replicate a Secret into every user {orch-namespace} and automatically mount as environment variables into every user container:
133
-
====
89
+
Add the annotation below if you want the Secret to be retained in a user {namespace}
90
+
after being deleted from {prod-namespace} namespace:
91
+
+
134
92
[source,yaml,subs="+attributes,+quotes"]
135
93
----
136
-
kind: Secret
137
-
apiVersion: v1
138
-
metadata:
139
-
name: {prod-id-short}-user-secret
140
-
namespace: {prod-namespace}
141
-
labels:
142
-
app.kubernetes.io/part-of: che.eclipse.org
143
-
app.kubernetes.io/component: workspaces-config
144
-
annotations:
145
-
controller.devfile.io/mount-as: env
146
-
stringData:
147
-
ENV_VAR_1: value_1
148
-
ENV_VAR_2: value_2
94
+
che.eclipse.org/sync-retain-on-delete: "true"
149
95
----
150
-
====
151
-
152
-
153
-
. Create the `PersistentVolumeClaim` below to replicate it to every user {orch-namespace}.
154
96
+
155
-
To enhance the configurability, you can customize the `PersistentVolumeClaim` by adding additional labels and annotations.
156
-
See the link:https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[Automatically mounting volumes, configmaps, and secrets]
97
+
See the link:https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[mounting volumes, configmaps, and secrets]
157
98
for other possible labels and annotations.
158
-
+
159
-
To modify the `PersistentVolumeClaim`, delete it and create a new one in {prod-namespace} namespace.
99
+
100
+
101
+
. Create the `PersistentVolumeClaim` below to create it to every user {orch-namespace}.
160
102
+
161
103
[source,yaml,subs="+attributes,+quotes"]
162
104
----
@@ -172,31 +114,20 @@ spec:
172
114
...
173
115
----
174
116
+
175
-
.Mounting a `PersistentVolumeClaim` to a user workspace:
176
-
====
117
+
To enhance the configurability, you can customize the `PersistentVolumeClaim` by adding additional labels and annotations.
118
+
+
119
+
The `PersistentVolumeClaim` is not deleted in a user {namespace} by default, if the one from {prod-namespace} is deleted.
120
+
Add the annotation below if you want the `PersistentVolumeClaim` to be deleted in a user {namespace} as well:
See the link:https://github.com/devfile/devworkspace-operator/blob/main/docs/additional-configuration.adoc#automatically-mounting-volumes-configmaps-and-secrets[mounting volumes, configmaps, and secrets]
129
+
for other possible labels and annotations.
130
+
+
200
131
201
132
. To leverage the OpenShift Kubernetes Engine, you can create a `Template` object to replicate all resources defined within the template across each user {orch-namespace}.
0 commit comments