Consume configuration without confusing versions
ConfigMaps hold configuration and Secrets are intended for sensitive data. Base64 is not encryption. Access to the object, mounted files, backups, and process still matters.
Distinguish an environment variable obtained at startup from a projected file: an object update does not rewrite an existing process environment. Secret volumes can receive delayed updates, but subPath does not receive that automatic update.
Even when a file changes, the application may need to reread it. Plan rotation with coexistence and revocation of the previous credential while observing which version each consumer uses.
Admission and scheduling are different phases
Quota can reject Pod creation before a Pending Pod exists. Inspect the creator’s error, for example ReplicaSet events, instead of searching for an object never created. An admitted Pod can remain Pending because no node simultaneously satisfies requests, required affinity, taints, volumes, and other constraints.
Free resources spread across nodes do not form one virtual node. Preferred affinity contributes a preference; required affinity excludes nonmatching nodes. A toleration removes a particular barrier without reserving capacity or requiring placement.
Autoscaling as calculation and control
For CPU utilization, compare consumption with the relevant request rather than the limit. In a simplified example with four replicas, complete metrics from ready Pods, 75% mean utilization, and a 50% target, the raw recommendation is ceil(4 × 75/50) = 6. min/maxReplicas, tolerance, missing metrics, readiness, and stabilization policies can limit effective action.
More replicas still require scheduling and capacity. Check HPA conditions and recommendations, available replicas, and client effect; do not declare recovery merely because desiredReplicas increased.
Accept a configuration change
The fragment connects APP_MODE to a ConfigMap and API_TOKEN to a Secret; both reference objects in the Pod namespace. It is a reading fragment to place inside a complete manifest’s container. Before delivery, confirm objects and keys exist and the image expects those names.
In a rollout with maxSurge, account for temporary capacity and quota as well as final state. Keep a recovery strategy compatible with data and the credential still accepted by the service. Investigate a live but unready application through the relevant signal, using the startup/readiness/liveness distinctions taught in the diagnosis lesson.
env:
- name: APP_MODE
valueFrom:
configMapKeyRef:
name: app-settings
key: mode
- name: API_TOKEN
valueFrom:
secretKeyRef:
name: api-credentials
key: tokenA rotation updates the Secret, but processes using an environment variable retain the previous credential. The replacement rollout creates no Pods because quota is exhausted. Identify both causes, arrange temporary capacity, and revoke the old credential only after observing updated consumers.
Common pitfalls
Confusing encoding with protection; interpreting Pending as admission rejection; summing capacity across nodes for one Pod; treating HPA recommendation as final availability.
Related topics: Kubernetes administration · Diagnosis and recovery
Connect consumed version to admission, capacity, and observed effect.
References
- Secrets · Kubernetes v1.37 documentation; relevant sections read 2026-10-23
- Resource quotas · Kubernetes v1.37 documentation; relevant sections read 2026-10-23
- Assigning Pods to nodes · Kubernetes v1.37 documentation; relevant sections read 2026-10-23
- Horizontal Pod Autoscaling · Kubernetes v1.37 documentation; relevant sections read 2026-10-23
- ConfigMaps · Kubernetes v1.35 documentation snapshot