With Kubernetes, you can use ConfigMaps to store pod configuration properties in key/value pairs. Information stored in ConfigMaps can be shared between pods, and can be used to set environment variables, command-line arguments, and even mount configuration files in a volume.

NOTE: Do not store sensitive information, such as passwords or tokens, in ConfigMaps. Instead, use Secrets.

Create a ConfigMap

  1. Click the Create button, and select Configuration:

2. Select the cluster where you would like to create the ConfigMap, and click the Continue button:

3. Enter the ConfigMap YAML, or drag & drop an existing ConfigMap file into the following screen:

4. When you are finished creating the ConfigMap, click the Deploy Button. In the example below, we defined a ConfigMap named postgres-env-vars , in the default namespace, with a single key/value pair: PGDATA . After the ConfigMap is deployed, any pod in the default namespace should be able to access the PGDATA  environment variable.

5. You should now see the newly created ConfigMap, in the Cluster's Configuration page:

6. Selecting View Details  allows you to view, edit, and delete the ConfigMap's YAML configuration:

Did this answer your question?