Kubernetes Configuration & Storage
Cheat sheet · https://pcornel.dk/topic.php?topic=6082
Answer
Kubernetes configuration and storage: ConfigMaps and Secrets inject configuration as environment variables or files; PersistentVolumeClaims request storage that a StorageClass/CSI driver provisions.
Remember
Env vars from ConfigMaps are read at start — restart pods after changes; mounted files update eventually. Secrets are only base64-encoded; enable encryption at rest and RBAC. PVCs must be Bound before pods can start.
First checks
kubectl get cm,secret -n <ns>— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
Verify in this order
ConfigMap/Secret/PVC created → referenced by pod → mounted/injected at start
Where it usually breaks
Failures include stale projected configuration, missing keys, base64 mistaken for encryption, PVCs stuck Pending, access-mode/topology conflicts, reclaim-policy surprises and application permissions that fail after a volume successfully mounts.
Kubernetes Configuration & Storage verification boundary matrix
| Boundary | Inspect | Healthy interpretation | Do not infer |
|---|---|---|---|
| Intent | ConfigMap | Intended object/scope is explicit and versioned where relevant | Intent is already effective |
| Owning runtime/control plane | Secret mechanics and boundaries / PersistentVolume / PersistentVolumeClaim | Owner accepts and reports the expected object state | Downstream dependencies are healthy |
| Effective state | StorageClass | Independent read-back matches the intended state | Every client sees the same result |
| Consumer outcome | Access modes | The original bounded check succeeds in the same time window | Production correctness outside this scope |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6082