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: enhancements/external-secrets-operator/external-secrets-component-config.md
+59-20Lines changed: 59 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ approvers:
9
9
api-approvers:
10
10
- "@tgeer"
11
11
creation-date: 2025-12-1
12
-
last-updated: 2025-12-1
12
+
last-updated: 2025-12-5
13
13
tracking-link:
14
14
- https://issues.redhat.com/browse/ESO-266
15
15
see-also:
@@ -24,7 +24,7 @@ superseded-by:
24
24
25
25
## Summary
26
26
27
-
This document proposes an enhancement to the `ExternalSecretsConfig` API by introducing a `ComponentConfig` extension and global annotations support thorugh`Annotations` field. This allows administrators to specify component-specific overrides for deployment lifecycle settings and global custom annotations for external-secrets components (Controller, Webhook, CertController, BitwardenSDKServer). This change offers administrators greater control over the resource management and operational parameters of components.
27
+
This document proposes an enhancement to the `ExternalSecretsConfig` API by introducing a `ComponentConfig` extension and global annotations support through`Annotations` field. This allows administrators to specify component-specific overrides for deployment lifecycle settings, custom environment variables, and global custom annotations for external-secrets components (Controller, Webhook, CertController, BitwardenSDKServer). This change offers administrators greater control over the resource management and operational parameters of components.
28
28
29
29
## Motivation
30
30
@@ -33,19 +33,21 @@ Administrators often need to control deployment lifecycle settings and add custo
33
33
### User Stories
34
34
35
35
- As an administrator, I want to customize deployment lifecycle properties for `external-secrets` operand components to manage their resource consumption and rollback behavior.
36
-
- As an operator user, I want to be able to set specific deployment override values independently for each component via ComponentConfig to meet unique operational requirements.
36
+
- As an `external-secrets` user, I want to be able to set specific deployment override values independently for each component via ComponentConfig to meet unique operational requirements.
37
37
- As a platform engineer, I want to add custom annotations to external-secrets deployments without modifying operator-managed resources.
38
+
- As an `external-secrets` user, I want to set custom environment variables for specific components to configure component behavior or integrate with external systems.
38
39
39
40
### Goals
40
41
41
42
- Provide a declarative API for specifying deployment lifecycle overrides for each component via `componentConfig`.
42
43
- Provide a declarative API for adding custom annotations globally to all component Deployments and Pod templates via `controllerConfig.annotations`.
44
+
- Provide a declarative API for specifying custom environment variables for each component via `componentConfig.overrideEnv`.
43
45
- Support all four operand components: Controller, Webhook, CertController, and BitwardenSDKServer.
44
46
45
47
### Non-Goals
46
48
47
49
- Exhaustive validation of individual argument values. Users should consult upstream documentation. Only basic structural validation (non-empty strings, list length limits) will be performed. Invalid arguments will result in container runtime failures (CrashLoopBackOff) rather than API rejection.
48
-
- Resource limits, replica counts, environment variables, or other deployment-level settings except for the RevisionHistoryLimit which is specifically introduced by this proposal.
50
+
- Resource limits, replica counts, or other deployment-level settings except for the RevisionHistoryLimit which is specifically introduced by this proposal.
49
51
50
52
## Proposal
51
53
@@ -64,9 +66,9 @@ Extend the ControllerConfig API with:
64
66
65
67
**For Component Configuration:**
66
68
67
-
1.**User Configuration:** Administrator updates the `ExternalSecretsConfig` CR, utilizing the new `componentConfig` list to specify configuration entries for a component (Controller, Webhook, etc.).
68
-
2.**Validation:** It verifies the `componentName` against the allowed enum values and enforces uniqueness across the list. It strictly validates the `OverrideArgs` field using the provided `XValidation` rule, ensuring every entry uses the specified format.
69
-
3.**Reconciliation:** It parses the `OverrideArgs` field to identify and extract the deployment override key and its corresponding value. It updates the component's underlying Kubernetes Deployment resource by setting the parsed override value in the appropriate `.spec` field.
69
+
1.**User Configuration:** Administrator updates the `ExternalSecretsConfig` CR, utilizing the new `componentConfig` list to specify configuration entries for a component (Controller, Webhook, etc.). This includes deployment-level overrides via `overrideArgs` and custom environment variables via `overrideEnv`.
70
+
2.**Validation:** It verifies the `componentName` against the allowed enum values and enforces uniqueness across the list. It strictly validates the `OverrideArgs` field using the provided `XValidation` rule, ensuring every entry uses the specified format. For `overrideEnv`, it validates that environment variable names and values conform to Kubernetes conventions.
71
+
3.**Reconciliation:** It parses the `OverrideArgs` field to identify and extract the deployment override key and its corresponding value. It updates the component's underlying Kubernetes Deployment resource by setting the parsed override value in the appropriate `.spec` field. For `overrideEnv`, the operator merges user-specified environment variables with default variables, with user values taking precedence in case of conflicts.
70
72
4.**Rollout:** Kubernetes detects the change in the Deployment's spec and performs a rolling update, applying the new setting to the component.
**Combined: annotations (global) with component-specific overrideArgs:**
164
+
**Set custom environment variables for a component:**
165
+
166
+
```yaml
167
+
apiVersion: operator.openshift.io/v1alpha1
168
+
kind: ExternalSecretsConfig
169
+
metadata:
170
+
name: cluster
171
+
spec:
172
+
controllerConfig:
173
+
componentConfig:
174
+
- componentName: ExternalSecretsCoreController
175
+
overrideEnv:
176
+
- name: HTTP_PROXY
177
+
value: "http://proxy.example.com:8080"
178
+
```
179
+
180
+
**Combined: annotations (global) with component-specific overrideArgs and overrideEnv:**
155
181
156
182
```yaml
157
183
apiVersion: operator.openshift.io/v1alpha1
@@ -168,6 +194,9 @@ spec:
168
194
- componentName: ExternalSecretsCoreController
169
195
overrideArgs:
170
196
- "RevisionHistoryLimit:10"
197
+
overrideEnv:
198
+
- name: HTTP_PROXY
199
+
value: "http://proxy.example.com:8080"
171
200
- componentName: Webhook
172
201
overrideArgs:
173
202
- "RevisionHistoryLimit:3"
@@ -195,6 +224,9 @@ None
195
224
* **Risk:** Users may accidentally override critical arguments required for proper operation.
196
225
* **Mitigation:** The operator will protect certain critical arguments from being overridden and will log warnings if users attempt to do so.
197
226
227
+
* **Risk:** Users may override critical environment variables required for proper component operation.
228
+
* **Mitigation:** The operator will protect certain critical environment variables from being overridden and will log warnings if users attempt to do so.
229
+
198
230
* **Risk:** Configuration changes may cause service disruption during rollout.
199
231
* **Mitigation:** Standard Kubernetes rolling update strategies will minimize disruption. Users can control rollout behavior through the deployment's update strategy.
200
232
@@ -211,20 +243,25 @@ None
211
243
3. Test parsing of deployment-level overrides (e.g., "RevisionHistoryLimit:5").
212
244
4. Test that invalid override formats are handled gracefully.
213
245
5. Test annotation merging logic with defaults and user overrides.
246
+
6. Test environment variable merging logic with defaults and user overrides.
247
+
7. Test that environment variable names conform to Kubernetes conventions.
214
248
215
249
* **Integration Tests:**
216
250
1. Deploy the operator and create an `ExternalSecretsConfig` with component configuration.
217
251
2. Verify that "RevisionHistoryLimit:X" is correctly applied to the deployment's `spec.revisionHistoryLimit`.
218
252
3. Verify that specified annotations appear on both Deployment and Pod template.
219
-
4. Update the configuration and verify the deployment is updated accordingly.
220
-
5. Remove the configuration and verify defaults are restored.
221
-
6. Attempt to apply a configuration that fails XValidation and verify the API server rejects the resource with the appropriate error message.
222
-
7. Test annotation override behavior when user annotation conflicts with operator default.
253
+
4. Verify that specified environment variables appear in the container spec.
254
+
5. Update the configuration and verify the deployment is updated accordingly.
255
+
6. Remove the configuration and verify defaults are restored.
256
+
7. Attempt to apply a configuration that fails XValidation and verify the API server rejects the resource with the appropriate error message.
257
+
8. Test annotation override behavior when user annotation conflicts with operator default.
258
+
9. Test environment variable override behavior when user variable conflicts with operator default.
223
259
224
260
* **End-to-End (E2E) Tests:**
225
261
1. Test each component type (Controller, Webhook, CertController, BitwardenSDKServer) individually.
226
262
2. Configure `RevisionHistoryLimit:X` and verify old ReplicaSets are cleaned up accordingly.
227
-
3. Verify that the operator correctly handles invalid configurations gracefully.
263
+
3. Configure custom environment variables and verify they are available in the running container.
264
+
4. Verify that the operator correctly handles invalid configurations gracefully.
228
265
229
266
## Graduation Criteria
230
267
@@ -233,6 +270,7 @@ This feature will be delivered as GA directly, as it uses stable Kubernetes APIs
233
270
* All API fields are implemented with proper validation.
234
271
* Argument merging logic is complete.
235
272
* Annotation merging logic is complete and applies to both Deployment and Pod template.
273
+
* Environment variable merging logic is complete and applies to the container spec.
236
274
* All tests outlined in the Test Plan are passing.
237
275
* Documentation includes examples for common use cases.
238
276
@@ -250,9 +288,9 @@ Not applicable.
250
288
251
289
## Upgrade / Downgrade Strategy
252
290
253
-
* **Upgrade:** On upgrade, the new `annotations` and `componentConfig` fields will be available. Existing installations without these configurations will continue to work with default settings. Users can optionally add annotationsand component configurations after upgrade.
291
+
* **Upgrade:** On upgrade, the new `annotations` and `componentConfig` fields (including `overrideArgs` and `overrideEnv`) will be available. Existing installations without these configurations will continue to work with default settings. Users can optionally add annotations, deployment overrides, and custom environment variables after upgrade.
254
292
255
-
* **Downgrade:** If a user downgrades to a version that doesn't support `annotations` or `componentConfig`, these fields will be ignored by the older operator. Deployments will revert to default configurations, and custom annotations will be removed. Users should be aware that custom configurations will be lost on downgrade.
293
+
* **Downgrade:** If a user downgrades to a version that doesn't support `annotations` or `componentConfig`, these fields will be ignored by the older operator. Deployments will revert to default configurations, custom annotations will be removed, and custom environment variables will be reset. Users should be aware that custom configurations will be lost on downgrade.
256
294
257
295
## Alternatives (Not Implemented)
258
296
@@ -266,9 +304,9 @@ NA
266
304
267
305
The `annotations` and `componentConfig` API extensions follow standard Kubernetes patterns:
268
306
269
-
* **Failure Modes:** Invalid configurations will be rejected by the API server validation. Invalid annotation formats will be rejected at the API level. Runtime failures (e.g., invalid arguments causing pod crashes) will be visible through standard pod status and events.
307
+
* **Failure Modes:** Invalid configurations will be rejected by the API server validation. Invalid annotation formats will be rejected at the API level. Invalid environment variable names will be rejected at the API level.
270
308
271
-
* **Support Procedures:** Administrators can verify the applied configuration by inspecting the deployment specs and comparing them to the `ExternalSecretsConfig` resource. Custom annotations can be verified on both Deployment and Pod template metadata.
309
+
* **Support Procedures:** Administrators can verify the applied configuration by inspecting the deployment specs and comparing them to the `ExternalSecretsConfig` resource. Custom annotations can be verified on both Deployment and Pod template metadata. Custom environment variables can be verified in the container spec of the Deployment.
272
310
273
311
## Support Procedures
274
312
@@ -277,6 +315,7 @@ Support personnel debugging configuration issues should:
277
315
1. Verify the `ExternalSecretsConfig` resource: `oc get externalsecretconfigs cluster -o yaml`
278
316
2. Compare the deployment spec to the expected configuration: `oc get deployment external-secrets -n external-secrets -o yaml`
279
317
3. Verify custom annotations are applied to Deployment and Pod template: check `.metadata.annotations` and `.spec.template.metadata.annotations` in the deployment spec.
280
-
4. Check pod logs for argument parsing errors.
281
-
5. Review events for the deployment: `oc get events -n external-secrets`
282
-
6. If a pod is failing to start due to invalid arguments, check the container's termination message and logs.
318
+
4. Verify custom environment variables are applied to containers: check `.spec.template.spec.containers[*].env` in the deployment spec.
319
+
5. Check pod logs for argument parsing errors or environment variable issues.
320
+
6. Review events for the deployment: `oc get events -n external-secrets`
321
+
7. If a pod is failing to start due to invalid arguments or environment variables, check the container's termination message and logs.
0 commit comments