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
Copy file name to clipboardExpand all lines: src/content/docs/reference/CRDs/workspace.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,9 +65,9 @@ The `from` field allows you to create a workspace by forking from an existing wo
65
65
|-------|------|-------------|----------|
66
66
| `name` | string | Name of the source workspace to fork from. | Yes |
67
67
| `namespace` | string | Namespace of the source workspace. | Yes (default: `default`) |
68
-
| `migrateData` | boolean | Whether to migrate persistent data (PVCs) from source workspace modules to the new workspace. | No (default: `false`) |
68
+
| `migrateData` | boolean | Whether to migrate persistent data (PVCs, Secrets, ConfigMaps) from source workspace modules to the new workspace. | No (default: `false`) |
69
69
70
-
**Note:** Data migration is not 100% guaranteed and depends on factors such as storage class compatibility, cluster connectivity, and PVC accessibility. The operator uses the `pv-migrate` tool to perform data migrations between workspaces.
70
+
**Note:** Data migration is not 100% guaranteed and depends on factors such as storage class compatibility, cluster connectivity, and resource accessibility.
71
71
72
72
**Example - Simple Forking:**
73
73
@@ -228,7 +228,7 @@ spec:
228
228
229
229
### Forking with Data Migration
230
230
231
-
Create a copy of an existing workspace and migrate persistent data (PVCs) from the source workspace:
231
+
Create a copy of an existing workspace and migrate persistent data (PVCs, Secrets, ConfigMaps) from the source workspace:
232
232
233
233
```yaml
234
234
apiVersion: batch.forkspacer.com/v1
@@ -245,10 +245,11 @@ spec:
245
245
**⚠️ Important Considerations for Data Migration:**
246
246
247
247
- **Temporary Downtime**: The migration process will temporarily hibernate both source and destination modules during data transfer to ensure data consistency
248
-
- **Migration Requirements**: Helm modules in the source workspace must have `migration.pvc` configuration defined in their resource definitions
249
-
- **Not 100% Guaranteed**: Migration may fail due to storage class incompatibilities, cluster connectivity issues, or PVC accessibility problems
250
-
- **Selective Migration**: Only Helm modules with PVC migration enabled will have their data migrated
248
+
- **Migration Requirements**: Helm modules in the source workspace must have migration configuration defined in their resource definitions (e.g., `migration.pvc`, `migration.secret`, `migration.configMap`)
249
+
- **Not 100% Guaranteed**: Migration may fail due to storage class incompatibilities, cluster connectivity issues, or resource accessibility problems
250
+
- **Selective Migration**: Only Helm modules with migration enabled for specific resource types will have their data migrated
251
251
- **Source Preservation**: The source workspace and its data remain unchanged after migration (original hibernation state is restored)
252
+
- **Immutable Resources**: If a Secret or ConfigMap is marked as immutable in the destination, it will be deleted and recreated while preserving its labels and annotations
Copy file name to clipboardExpand all lines: src/content/docs/reference/Resources/helm.md
+45-9Lines changed: 45 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ cleanup:
163
163
164
164
### Migration
165
165
166
-
Configure data migration behavior for workspace forking. When a workspace is forked with `migrateData: true`, the operator will migrate PersistentVolumeClaims (PVCs) from the source module to the destination module.
166
+
Configure data migration behavior for workspace forking. When a workspace is forked with `migrateData: true`, the operator will migrate PersistentVolumeClaims (PVCs), Secrets, and ConfigMaps from the source module to the destination module.
167
167
168
168
```yaml
169
169
migration:
@@ -172,34 +172,50 @@ migration:
172
172
names: # List of PVC names to migrate (supports templating)
173
173
- "data-{{ .releaseName }}-0"
174
174
- "logs-{{ .releaseName }}-0"
175
+
secret:
176
+
enabled: true # Enable Secret migration for this module
177
+
names: # List of Secret names to migrate (supports templating)
178
+
- "{{ .releaseName }}"
179
+
- "{{ .releaseName }}-tls"
180
+
configMap:
181
+
enabled: true # Enable ConfigMap migration for this module
182
+
names: # List of ConfigMap names to migrate (supports templating)
183
+
- "{{ .releaseName }}-config"
175
184
```
176
185
177
186
**Fields:**
178
187
179
188
| Field | Type | Description | Required |
180
189
|-------|------|-------------|----------|
181
190
| `pvc.enabled` | boolean | Enable PVC migration for this Helm module | No (default: `false`) |
182
-
| `pvc.names` | array of strings | List of PVC names to migrate. Supports Go templating with `.releaseName` and `.config.*` variables. | Yes (when enabled) |
191
+
| `pvc.names` | array of strings | List of PVC names to migrate. Supports Go templating with `.releaseName` and `.config.*` variables. | Yes (when `pvc.enabled` is true) |
192
+
| `secret.enabled` | boolean | Enable Secret migration for this Helm module | No (default: `false`) |
193
+
| `secret.names` | array of strings | List of Secret names to migrate. Supports Go templating with `.releaseName` and `.config.*` variables. | Yes (when `secret.enabled` is true) |
194
+
| `configMap.enabled` | boolean | Enable ConfigMap migration for this Helm module | No (default: `false`) |
195
+
| `configMap.names` | array of strings | List of ConfigMap names to migrate. Supports Go templating with `.releaseName` and `.config.*` variables. | Yes (when `configMap.enabled` is true) |
183
196
184
197
**How Migration Works:**
185
198
186
199
1. When a workspace is forked with `migrateData: true`, the operator identifies all modules with migration enabled
187
200
2. For each module, the operator:
188
201
- Creates a new module instance in the destination workspace
189
202
- Hibernates both source and destination modules
190
-
- Migrates the specified PVCs using the [pv-migrate](https://github.com/utkuozdemir/pv-migrate) tool
203
+
- Migrates PVCs (if enabled)
204
+
- Migrates Secrets (if enabled)
205
+
- Migrates ConfigMaps (if enabled)
191
206
- Restores the source module to its original state
192
-
- Wakes up the both source and destination modules
207
+
- Wakes up both source and destination modules
193
208
194
209
**⚠️ Important Notes:**
195
210
196
211
- **Temporary Downtime**: Both source and destination modules are temporarily hibernated during migration to ensure data consistency
197
-
- **Not 100% Guaranteed**: Migration depends on storage class compatibility, cluster connectivity, and PVC accessibility
198
-
- **Template Support**: PVC names support templating to dynamically reference the release name and config values
199
-
- **Selective Migration**: Only the specified PVCs are migrated; other data or configurations must be handled separately
212
+
- **Not 100% Guaranteed**: Migration depends on storage class compatibility, cluster connectivity, and resource accessibility
213
+
- **Template Support**: Resource names support templating to dynamically reference the release name and config values
214
+
- **Selective Migration**: Only the specified resources are migrated; other data or configurations must be handled separately
200
215
- **Source Preservation**: The source workspace and its data remain unchanged after migration
216
+
- **Immutable Resources**: If a Secret or ConfigMap is marked as immutable in the destination, it will be deleted and recreated while preserving its labels and annotations
201
217
202
-
**Example with Redis (Single Master):**
218
+
**Example with Redis (Single Master with PVC and Secret migration):**
203
219
204
220
```yaml
205
221
spec:
@@ -220,6 +236,10 @@ spec:
220
236
enabled: true
221
237
names:
222
238
- "redis-data-{{ .releaseName }}-master-0"
239
+
secret:
240
+
enabled: true
241
+
names:
242
+
- "{{ .releaseName }}" # Migrates the Redis password secret
223
243
```
224
244
225
245
**Example with Redis (Master + Replicas):**
@@ -240,7 +260,7 @@ spec:
240
260
- "redis-data-{{ .releaseName }}-replicas-1"
241
261
```
242
262
243
-
**Example with PostgreSQL:**
263
+
**Example with PostgreSQL (with PVC, Secret, and ConfigMap migration):**
0 commit comments