Using Harness Config Variables in Manifests
You can create a variable in the Harness Kubernetes Service Config Variables section and then use it in your Manifests files, such as in the ConfigMap definition.
In this topic:
- Before You Begin
- Step 1: Create the Service Variable in Config Variables
- Step 2: Reference the Service Variable in values.yaml
- Step 3: Reference the Variable in the Manifest
- Notes
- Next Steps
Before You Begin
${CONFIG_MAP_NAME}
expression and all unencrypted Service Config Variables and Config Files. In the current Harness Kubernetes implementation, you define your ConfigMap manually using the values.yaml and Config Variables and Config Files.Step 1: Create the Service Variable in Config Variables
For this explanation, we'll create a variable that indicates the database to use for a ConfigMap.
- In Config Variables, click Add Variable.
- In Config Variable, add a variable named
database
with the valuemongodb
.

- Click Submit. The variable is added to the Config Variables section.

Step 2: Reference the Service Variable in values.yaml
- In values.yaml, create a new variable named
databaseType
that references the Service variabledatabase
:

Step 3: Reference the Variable in the Manifest
- In the manifest file containing you object (in this example, ConfigMap), reference the values.yaml variable in the ConfigMap
data
section.

When the Service is deployed, the Service variable will be used to provide the value mongodb
to the data
label in ConfigMap.
Notes
- You can also overwrite the Service variable in an Environment Service Configuration Override. When a Workflow using that Service and Environment deploys, the Service variable for the ConfigMap
data
value will be overwritten. See Override Harness Kubernetes Service Settings.