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/module.md
+123Lines changed: 123 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,9 @@ The `source` field specifies where the resource definition should be loaded from
91
91
| Field | Type | Description | Required |
92
92
|-------|------|-------------|----------|
93
93
| `raw` | object | Raw resource definition embedded directly in the Module resource. | No |
94
+
| `configMap` | object | Reference to a ConfigMap containing the resource definition. See [ConfigMapSource](#configmapsource). | No |
94
95
| `httpURL` | string | HTTP/HTTPS URL pointing to a resource definition YAML file. | No |
96
+
| `existingHelmRelease` | object | Reference to an existing Helm release to adopt and track. See [ExistingHelmReleaseSource](#existinghelmreleasesource). | No |
95
97
96
98
**Resource Definition Types:**
97
99
@@ -127,6 +129,68 @@ spec:
127
129
version: 15.0.0
128
130
```
129
131
132
+
**Example - ConfigMap Source:**
133
+
134
+
```yaml
135
+
spec:
136
+
source:
137
+
configMap:
138
+
name: redis-module-definition
139
+
namespace: default
140
+
```
141
+
142
+
**Example - Existing Helm Release:**
143
+
144
+
```yaml
145
+
spec:
146
+
source:
147
+
existingHelmRelease:
148
+
name: redis
149
+
namespace: default
150
+
```
151
+
152
+
#### ConfigMapSource
153
+
154
+
The `configMap` source type references a Kubernetes ConfigMap that contains the resource definition.
155
+
156
+
| Field | Type | Description | Required |
157
+
|-------|------|-------------|----------|
158
+
| `name` | string | Name of the ConfigMap. | Yes |
159
+
| `namespace` | string | Namespace of the ConfigMap. | No (defaults to Module's namespace) |
160
+
161
+
The ConfigMap must contain a key named `module.yaml` with the resource definition as its value:
162
+
163
+
```yaml
164
+
apiVersion: v1
165
+
kind: ConfigMap
166
+
metadata:
167
+
name: redis-module-definition
168
+
namespace: default
169
+
data:
170
+
module.yaml: |
171
+
kind: Helm
172
+
metadata:
173
+
name: redis
174
+
version: "1.0.0"
175
+
supportedOperatorVersion: ">= 0.0.0, < 1.0.0"
176
+
spec:
177
+
namespace: default
178
+
repo: https://charts.bitnami.com/bitnami
179
+
chartName: redis
180
+
version: 21.2.9
181
+
```
182
+
183
+
#### ExistingHelmReleaseSource
184
+
185
+
The `existingHelmRelease` source type allows you to adopt and track existing Helm releases without reinstalling them. This is useful when you have pre-existing Helm releases in your cluster and want to manage them through Forkspacer without disruption.
186
+
187
+
| Field | Type | Description | Required |
188
+
|-------|------|-------------|----------|
189
+
| `name` | string | Name of the existing Helm release. | Yes |
190
+
| `namespace` | string | Namespace where the Helm release is installed. | No (defaults to `default`) |
191
+
192
+
**Important:** When a Module with an adopted Helm release is deleted, the underlying Helm release is **not** uninstalled. The Module only detaches from the release, leaving it running in the cluster.
193
+
130
194
### WorkspaceReference
131
195
132
196
The `workspace` field references the target workspace where the module will be deployed.
@@ -294,6 +358,65 @@ spec:
294
358
hibernated: true
295
359
```
296
360
361
+
### Installing a Module from ConfigMap
362
+
363
+
```yaml
364
+
# First, create the ConfigMap with the module definition
365
+
apiVersion: v1
366
+
kind: ConfigMap
367
+
metadata:
368
+
name: postgresql-module
369
+
namespace: default
370
+
data:
371
+
module.yaml: |
372
+
kind: Helm
373
+
metadata:
374
+
name: postgresql
375
+
version: "1.0.0"
376
+
supportedOperatorVersion: ">= 0.0.0, < 1.0.0"
377
+
spec:
378
+
namespace: default
379
+
repo: https://charts.bitnami.com/bitnami
380
+
chartName: postgresql
381
+
version: 12.0.0
382
+
383
+
---
384
+
# Then, create the Module referencing the ConfigMap
385
+
apiVersion: batch.forkspacer.com/v1
386
+
kind: Module
387
+
metadata:
388
+
name: postgresql
389
+
namespace: default
390
+
spec:
391
+
workspace:
392
+
name: dev-environment
393
+
source:
394
+
configMap:
395
+
name: postgresql-module
396
+
namespace: default
397
+
config:
398
+
storageSize: "10Gi"
399
+
```
400
+
401
+
### Adopting an Existing Helm Release
402
+
403
+
```yaml
404
+
apiVersion: batch.forkspacer.com/v1
405
+
kind: Module
406
+
metadata:
407
+
name: existing-redis
408
+
namespace: default
409
+
spec:
410
+
workspace:
411
+
name: production-workspace
412
+
source:
413
+
existingHelmRelease:
414
+
name: redis
415
+
namespace: default
416
+
```
417
+
418
+
This Module will track the existing `redis` Helm release without reinstalling it. When the Module is deleted, the Helm release will remain running in the cluster.
419
+
297
420
## Module Lifecycle
298
421
299
422
1. **Installation**: When a Module is created, the operator fetches the resource definition from the specified source and processes it based on its kind (Helm or Custom).
0 commit comments