Pcornel
Containers

Kubernetes Configuration & Storage

Cheat sheet · https://pcornel.dk/topic.php?topic=6082

Back to the Topic

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 topic
  • kubectl get pods -o wide — pods, status, node, IP
  • kubectl describe pod <pod> — events and conditions
  • kubectl 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

BoundaryInspectHealthy interpretationDo not infer
IntentConfigMapIntended object/scope is explicit and versioned where relevantIntent is already effective
Owning runtime/control planeSecret mechanics and boundaries / PersistentVolume / PersistentVolumeClaimOwner accepts and reports the expected object stateDownstream dependencies are healthy
Effective stateStorageClassIndependent read-back matches the intended stateEvery client sees the same result
Consumer outcomeAccess modesThe original bounded check succeeds in the same time windowProduction 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

Confirmation

Confirm action

Continue?