ConfigMap on Kubernetes

ConfigMap on Kubernetes

  • Configuration parameters that are not secrets can be stored in a config map.

  • The input consists of key-value pairs.

  • Apps can read the configMap key-value pairs via environment variables, volumes, or container command-line arguments in pod configuration.

  • A configMap may also include whole configuration files, such as the config file for a web server. This file can then be mounted using volumes where the application expects it's config file. This allows you to inject configuration settings into the container without having to change it.

  • To generate ConfigMap using file:

kubectl create configmap <configmap-name> --from-file=<your file>