Skip to main content
The applications-live repository for your installation supports Kubernetes ConfigMaps as a separate resource type next to Secrets. Store non-sensitive configuration, such as endpoints, feature settings, or mapping files, in a ConfigMap. Store sensitive values in a Secret encrypted with Secrets Operations (SOPS).

ConfigMap or Secret

The following table compares ConfigMaps and Secrets.
Don’t put sensitive values in a ConfigMap. You store ConfigMaps as plain YAML. Store sensitive values in a SOPS-encrypted Secret instead.

Path and kind rules

Place ConfigMap manifests under runtimes/<env>/configmaps/, where <env> is the runtime, such as dev or test:
The following rules apply:
  • The configmaps/ folder accepts only resources with kind: ConfigMap.
  • The secrets/ folder accepts only resources with kind: Secret.
  • Use the .yaml or .yml file extension.
  • Place manifests directly in the configmaps/ folder. Argo CD doesn’t sync subfolders.
The pull request check for the applications-live repository fails if the configmaps/ folder contains anything other than a ConfigMap, or if the secrets/ folder contains a ConfigMap. If the check fails, don’t merge the change. Move the file to the correct folder or correct its kind, and then push again. Argo CD syncs the configmaps/ folder automatically with pruning and self-healing. If you remove a file from the folder, Argo CD deletes the ConfigMap from the cluster. If you change a ConfigMap directly in the cluster, Argo CD reverts the change. If you need details about how a specific installation enforces these rules, contact your Managed Hosting team representative.

Create a ConfigMap

As with Secrets, don’t set the metadata.namespace field in the manifest. The platform creates the ConfigMap in the default namespace of the runtime. For more information about namespaces, see Deployment namespace. In the following minimal example, you save the manifest as runtimes/test/configmaps/my-connector-config.yaml. The name and keys are examples:

Use a ConfigMap in a connector

Reference the ConfigMap by its metadata.name from the workload that runs in the same namespace. The following snippets show the standard Kubernetes mechanisms. How you pass them through the connector’s values depends on the chart, so check the chart’s values reference for the matching fields. To pass a single key as an environment variable, use configMapKeyRef:
To pass all keys as environment variables, use envFrom:
To mount keys as files, define a volume in the pod spec and mount it in the container spec:
Kubernetes updates mounted ConfigMap files over time, but it doesn’t update environment variables in a running pod. It also doesn’t update files that you mount with subPath. Restart the workload after you change a ConfigMap that you consume as environment variables or through a subPath mount.

Migrate ConfigMaps out of secrets/

If you previously stored a ConfigMap under runtimes/<env>/secrets/, move it:
  1. Move the manifest to runtimes/<env>/configmaps/.
  2. Recreate the manifest as plain YAML with the same keys and values. Confirm that the manifest contains no sensitive values. If you can’t recreate the manifest, contact your Managed Hosting team representative.
  3. Remove any manually set metadata.namespace.
  4. Keep the same metadata.name so that references continue to work.
  5. Open a pull request and check the sync status in Argo CD after the merge.
For more information about managing Secrets, see Configure connectors.