Hardcoding config in containers requires rebuilding images. ConfigMaps separate config from code.
Create ConfigMap:
kubectl create configmap app-config \ --from-literal=API_URL=https://api.example.com \ --from-literal=MAX_RETRIES=3
Use in Pod:
apiVersion: v1
kind: Pod
metadata:
name: myapp
spec:
containers:
- name: app
image: myapp:1.0
envFrom:
- configMapRef:
name: app-config
Change config without rebuilding image – just update ConfigMap!
Update ConfigMap: kubectl edit configmap app-config
