ConfigMaps

πŸš€ What It Does

A ConfigMap in Kubernetes is used to externalize configuration data from your application code. It allows you to store key-value pairs or configuration files that your pods can consume at runtime, making your applications more portable and easier to manage.

🧩 Key Features

  • Key-Value Storage: Stores configuration as simple key-value pairs or entire files.
  • Decoupling: Keeps configuration separate from container images, enabling reuse and flexibility.
  • Multiple Consumption Methods:
    • As environment variables
    • As command-line arguments
    • Mounted as files in a volume
  • Dynamic Updates: When mounted as volumes, changes to the ConfigMap can be reflected in the pod without restarting it (depending on how the app handles it).

βš™οΈ How It Works

  1. You create a ConfigMap using kubectl or a YAML manifest.
  2. The ConfigMap is stored in the Kubernetes API server.
  3. Pods reference the ConfigMap to inject configuration at runtime.
  4. If the ConfigMap is updated, the changes can be picked up by the pods (depending on how it’s consumed).

Kubernetes ConfigMap Kubernetes ConfigMap