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: docs/concepts/worker-pools/kubernetes-workers.md
+21-29Lines changed: 21 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,23 +112,24 @@ If you are using OpenShift, additional steps are required to allow the controlle
112
112
113
113
## Create a WorkerPool
114
114
115
-
The recommended approach for deploying worker pools is to use auto-registration.
116
-
117
-
With auto-registration, the controller automatically creates and manages worker pools in Spacelift without requiring manual setup steps in the UI. When you create a WorkerPool resource without token and privateKey credentials, the controller handles the complete lifecycle: it registers the pool with Spacelift, generates the required credentials, stores them securely in Kubernetes secrets, and manages ongoing operations.
118
-
119
-
This approach enables true GitOps workflows where worker pools can be provisioned declaratively alongside other infrastructure.
120
-
There's no need to coordinate between the Spacelift UI and your Kubernetes deployment, eliminating potential errors and simplifying automation.
115
+
The recommended approach for deploying worker pools is to use [auto-registration](#auto-registration).
121
116
122
117
With OIDC secret configuration, you can also avoid storing static Spacelift credentials in the cluster.
123
118
124
-
You can also create the WorkerPool manually on Spacelift, and save its secrets on the cluster. That's still a perfectly valid approach if you do not want to use auto registration.
119
+
You can also [create the WorkerPool manually](#manual-registration) on Spacelift, and save its secrets on the cluster. That's still a perfectly valid approach if you do not want to use auto registration.
125
120
126
121
### Auto-Registration
127
122
123
+
With auto-registration, the controller automatically creates and manages worker pools in Spacelift without requiring manual setup steps in the UI.
124
+
When you create a WorkerPool resource without token and privateKey credentials, the controller handles the complete lifecycle: it registers the pool with Spacelift, generates the required credentials, stores them securely in Kubernetes secrets, and manages ongoing operations.
125
+
126
+
This approach enables true GitOps workflows where worker pools can be provisioned declaratively alongside other infrastructure.
127
+
There's no need to coordinate between the Spacelift UI and your Kubernetes deployment, eliminating potential errors and simplifying automation.
128
+
128
129
!!! warning
129
130
When using auto registration, it's impossible to update and reset the workerpool from the Spacelift UI. The reason for that is to make obvious that the pool is managed from the cluster, and avoid conflicts by forcing a single source of truth.
130
131
131
-
#### Create a Secret
132
+
#### Create an API Key
132
133
133
134
For auto registration to work, you need to create a Spacelift API key to allow the controller to manage worker pools in Spacelift. This key should be granted the `Worker pool controller` role forthe space that your worker pool will be created in, and needs to be storedin a secret called `spacelift-api-credentials`in the same namespace as the Kubernetes controller (by default `spacelift-worker-controller-system`).
134
135
@@ -142,8 +143,8 @@ For auto registration to work, you need to create a Spacelift API key to allow t
- **Subject Expression**: `^system:serviceaccount:NAMESPACE:SERVICE_ACCOUNT_NAME$` (replace `NAMESPACE` and `SERVICE_ACCOUNT_NAME` with yours)
185
+
184
186
185
187
The controller's service account token contains these claims, allowing it to authenticate with Spacelift without any static credentials.
186
188
@@ -196,23 +198,10 @@ metadata:
196
198
name: auto-registered-pool
197
199
spec:
198
200
poolSize: 2
199
-
200
-
# You can also eventually configure the following optional Spacelift-related attributes
201
-
202
-
# Specify which Spacelift space to create the pool in
203
-
space: production
204
-
205
-
# Add a description for documentation purposes
206
-
description: Production worker pool for infrastructure deployments
207
-
208
-
# Configure drift detection limits
209
-
driftDetectionRunLimits:
210
-
# Set maximum number of concurrent drift detection runs
211
-
maxRuns: 5
212
201
EOF
213
202
```
214
203
215
-
You can refer to the `WorkerPool` CRD for more details.
204
+
You can refer to the [`WorkerPool`](#configuration) CRD for all optional fields. There are fields specific for auto registration that configures how your pool is setup in Spacelift.
216
205
217
206
### Manual Registration
218
207
@@ -314,8 +303,11 @@ If you installed the controller using the Helm chart, the RBAC permissions are a
314
303
The same applies if you installed using kubectl with raw manifests. The updated permissions are included in the manifests.
315
304
316
305
No action is required for existing manually registered worker pools, they will continue to work exactly as before.
317
-
The new auto-registration feature is opt-in and only activates when you create WorkerPool resources without token and privateKey credentials,
318
-
and if a Spacelift credentials secret is configured.
306
+
307
+
The new auto-registration feature is opt-in, and only activates when the following conditions are both true:
308
+
309
+
- You create a WorkerPool resource without specifying the `token` and `privateKey`.
310
+
- You provide a `spacelift-api-credentials` secret in the same namespace as your controller containing your API credentials.
319
311
320
312
### Upgrading to controller v0.0.17 - or Helm chart v0.33.0
321
313
@@ -537,7 +529,7 @@ spec:
537
529
# space allows you to specify which Spacelift space to create the pool in.
538
530
# Only applies to auto-registered pools.
539
531
# Optional
540
-
space: production
532
+
space: production-01ARZ3NDEKTSV4RRFFQ69G5FAV
541
533
542
534
# description sets a description for the worker pool.
543
535
# Useful for documentation and organization in the Spacelift UI.
0 commit comments