ConfigMaps
Why ConfigMaps
Keep environment-specific settings out of the container image so one image works in many environments.
Create from literals
Simple key/value example:
kubectl create configmap app-config \
--from-literal=APP_MESSAGE=Hello \
--from-literal=APP_COLOR=blue
kubectl get configmap app-config -o yaml
Use in a pod (concept)
Pods can load ConfigMap keys as environment variables or files. In YAML you reference the ConfigMap by name.
# Snippet idea inside a container spec:
# envFrom:
# - configMapRef:
# name: app-config
Not for secrets
Do not put passwords or API keys in ConfigMaps—use Secrets (next lesson) and real secret managers as you mature.
Comments
One comment per signed-in account. Comments are saved with this page’s URL.