Setting custom environment variables for external-secrets components
To configure component behavior at runtime or integrate with external services, set custom environment variables for individual external-secrets components.
Custom environment variables are merged with the default environment variables set by the Operator. User-specified variables take precedence in case of conflicts with the Operator defaults. A maximum of 50 custom environment variables can be specified per component.
The environment variable names starting with the following prefixes are reserved:
-
HOSTNAME -
KUBERNETES_ -
EXTERNAL_SECRETS_
-
You have access to the cluster with
cluster-adminprivileges. -
You have created the
ExternalSecretsConfigcustom resource.
-
Edit the
ExternalSecretsConfigCR by running the following command:$ oc edit externalsecretsconfigs.operator.openshift.io cluster -
Add the
overrideEnvfield under the desired component in thespec.controllerConfig.componentConfigsstanza as follows:apiVersion: operator.openshift.io/v1alpha1 kind: ExternalSecretsConfig metadata: name: cluster spec: controllerConfig: componentConfigs: - componentName: ExternalSecretsCoreController overrideEnv: - name: Example value: "4"where
spec.controllerConfig.componentConfigs.overrideEnv.name-
Specifies the name of the environment variable. Environment variable names starting with
HOSTNAME,KUBERNETES_, orEXTERNAL_SECRETS_are reserved and are not allowed. spec.controllerConfig.componentConfigs.overrideEnv.value-
Specifies the value of the environment variable.
-
Verify that the environment variable is set on the deployment by running the following command:
$ oc set env deployment/external-secrets -n external-secrets --listThe output should include the custom environment variable you specified.