Skip to content

Commit ae6d214

Browse files
committed
update to v0.1.9
1 parent 63e0f58 commit ae6d214

File tree

2 files changed

+52
-15
lines changed

2 files changed

+52
-15
lines changed

src/content/docs/reference/CRDs/workspace.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ The `from` field allows you to create a workspace by forking from an existing wo
6565
|-------|------|-------------|----------|
6666
| `name` | string | Name of the source workspace to fork from. | Yes |
6767
| `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`) |
6969

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.
7171

7272
**Example - Simple Forking:**
7373

@@ -228,7 +228,7 @@ spec:
228228

229229
### Forking with Data Migration
230230

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:
232232

233233
```yaml
234234
apiVersion: batch.forkspacer.com/v1
@@ -245,10 +245,11 @@ spec:
245245
**⚠️ Important Considerations for Data Migration:**
246246

247247
- **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
251251
- **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
252253

253254
### Hibernating a Workspace Manually
254255

src/content/docs/reference/Resources/helm.md

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ cleanup:
163163

164164
### Migration
165165

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.
167167

168168
```yaml
169169
migration:
@@ -172,34 +172,50 @@ migration:
172172
names: # List of PVC names to migrate (supports templating)
173173
- "data-{{ .releaseName }}-0"
174174
- "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"
175184
```
176185

177186
**Fields:**
178187

179188
| Field | Type | Description | Required |
180189
|-------|------|-------------|----------|
181190
| `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) |
183196

184197
**How Migration Works:**
185198

186199
1. When a workspace is forked with `migrateData: true`, the operator identifies all modules with migration enabled
187200
2. For each module, the operator:
188201
- Creates a new module instance in the destination workspace
189202
- 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)
191206
- 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
193208

194209
**⚠️ Important Notes:**
195210

196211
- **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
200215
- **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
201217

202-
**Example with Redis (Single Master):**
218+
**Example with Redis (Single Master with PVC and Secret migration):**
203219

204220
```yaml
205221
spec:
@@ -220,6 +236,10 @@ spec:
220236
enabled: true
221237
names:
222238
- "redis-data-{{ .releaseName }}-master-0"
239+
secret:
240+
enabled: true
241+
names:
242+
- "{{ .releaseName }}" # Migrates the Redis password secret
223243
```
224244

225245
**Example with Redis (Master + Replicas):**
@@ -240,7 +260,7 @@ spec:
240260
- "redis-data-{{ .releaseName }}-replicas-1"
241261
```
242262

243-
**Example with PostgreSQL:**
263+
**Example with PostgreSQL (with PVC, Secret, and ConfigMap migration):**
244264

245265
```yaml
246266
spec:
@@ -259,6 +279,14 @@ spec:
259279
enabled: true
260280
names:
261281
- "data-{{ .releaseName }}-postgresql-0"
282+
secret:
283+
enabled: true
284+
names:
285+
- "{{ .releaseName }}" # Migrates PostgreSQL password secret
286+
configMap:
287+
enabled: true
288+
names:
289+
- "{{ .releaseName }}-configuration" # Migrates PostgreSQL configuration
262290
```
263291

264292
## Templating
@@ -476,6 +504,10 @@ spec:
476504
enabled: true
477505
names:
478506
- "redis-data-{{ .releaseName }}-master-0"
507+
secret:
508+
enabled: true
509+
names:
510+
- "{{ .releaseName }}" # Migrates Redis password secret
479511
```
480512

481513
## Usage in Modules
@@ -536,6 +568,10 @@ spec:
536568
enabled: true
537569
names:
538570
- "redis-data-{{ .releaseName }}-master-0"
571+
secret:
572+
enabled: true
573+
names:
574+
- "{{ .releaseName }}"
539575
```
540576

541577
## Values File Distribution

0 commit comments

Comments
 (0)