Kubernetes Configuration Patterns 101

Topic 6: ConfigMap

Vino Alex
1 min readDec 14, 2022

ConfigMap

A ConfigMap is an API object that stores non-confidential data in key-value pairs. Pods can consume ConfigMaps as environment variables, command-line arguments, or as configuration files in a volume.

A ConfigMap allows you to decouple environment-specific configuration from your Container Images, making your applications easily portable. The data stored in a ConfigMap cannot exceed 1 MiB.

If you need to store settings larger than this limit, consider mounting a volume or using a separate database or file service.

There are four different ways that you can use a ConfigMap to configure a container inside a Pod:

1. Inside a container command and args

2. Environment variables for a container

3. Add a file in read-only volume for the application to read

4. Write code to run inside the Pod that uses the Kubernetes API to read a ConfigMap

ConfigMap

--

--