Skip to content

Kubernetes and deployment ​

Encyclopedia home · Search machine-readable catalog

The broken snippets are deliberate negative examples. Use only in an isolated fixture repository or lab.

F083 ​

Wrong kubeconfig context

Symptom. namespace or object differs from intended deployment.

Root cause. Default context can point to another cluster.

Broken example

bash
kubectl apply -f web.yaml

Corrected example

bash
test "$(kubectl config current-context)" = "${EXPECTED_CONTEXT:?}"
kubectl --context "$EXPECTED_CONTEXT" -n staging apply --dry-run=server -f web.yaml

Verification. Test with a second local context and confirm preflight fails closed.

Correction validation syntax-validated.

F084 ​

Wrong namespace

Symptom. deployments.apps web not found.

Root cause. Resource exists outside default namespace.

Broken example

bash
kubectl rollout status deployment/web

Corrected example

bash
kubectl -n staging rollout status deployment/web --timeout=180s

Verification. Verify namespace and discover matching deployment.

Correction validation syntax-validated.

F085 ​

Manifest API version removed

Symptom. no matches for kind Ingress.

Root cause. Modern cluster removed extensions API for Ingress.

Broken example

yaml
apiVersion: extensions/v1beta1
kind: Ingress

Corrected example

yaml
apiVersion: networking.k8s.io/v1
kind: Ingress

Verification. Migrate backend schema too and run server dry run.

Correction validation syntax-validated.

F086 ​

Container not ready

Symptom. Readiness probe failed HTTP statuscode 404.

Root cause. Probe route differs from service contract.

Broken example

yaml
readinessProbe: {httpGet: {path: /wrong, port: 8000}}

Corrected example

yaml
readinessProbe: {httpGet: {path: /readyz, port: 8000}}

Verification. Verify Pod Ready and EndpointSlice routing.

Correction validation syntax-validated.

F087 ​

ImagePullBackOff

Symptom. Failed to pull image and ImagePullBackOff.

Root cause. Reference doesn't exist or credentials are not scoped.

Broken example

yaml
image: registry.example.com/web:missing

Corrected example

yaml
image: registry.example.com/web:validated-staging

Verification. Check actual candidate digest and probe Registry access before applying.

Correction validation syntax-validated.

F088 ​

CrashLoopBackOff missing required config

Symptom. back-off restarting failed container.

Root cause. Process starts without required configuration variable.

Broken example

yaml
env: []

Corrected example

yaml
env:
  - name: CONFIG_PATH
    value: /etc/web/config.toml

Verification. Check previous logs and mount the referenced ConfigMap.

Correction validation syntax-validated.

F089 ​

Resource unable to schedule

Symptom. FailedScheduling Insufficient cpu/memory.

Root cause. Requests exceed eligible node capacity in lab.

Broken example

yaml
requests: {cpu: "64", memory: 128Gi}

Corrected example

yaml
requests: {cpu: "250m", memory: 128Mi}

Verification. Set based on observed workload and recheck scheduling events.

Correction validation syntax-validated.

F090 ​

Service selects wrong label

Symptom. EndpointSlices contain no ready endpoints.

Root cause. Selector does not match Pod labels.

Broken example

yaml
selector: {component: web}

Corrected example

yaml
selector: {app: web}

Verification. Compare selectors to actual Pods and smoke-test the Service.

Correction validation syntax-validated.

F091 ​

Service port target mismatch

Symptom. connection refused despite healthy Pods.

Root cause. Service maps traffic to a port the app doesn't use.

Broken example

yaml
- {port: 80, targetPort: 9000}

Corrected example

yaml
- {port: 80, targetPort: 8000}

Verification. Probe Service and Pod directly to isolate routing.

Correction validation syntax-validated.

F092 ​

Rollback fights GitOps desired state

Symptom. reverted image reappears.

Root cause. Controller reconciles toward current Git target.

Broken example

bash
kubectl -n staging rollout undo deployment/web

Corrected example

bash
git revert "${BAD_CONFIG_COMMIT:?}"

Verification. Review and submit revert via approved GitOps path. Observe expected revision and rollout.

Correction validation syntax-validated.

F093 ​

Apply waits incorrectly for health

Symptom. run reports success while Pods fail.

Root cause. Apply returns before deployment convergence.

Broken example

bash
kubectl -n staging apply -f web.yaml

Corrected example

bash
kubectl -n staging apply -f web.yaml
kubectl -n staging rollout status deploy/web --timeout=180s

Verification. Force a bad readiness fixture and verify pipeline fails.

Correction validation syntax-validated.

F094 ​

Namespace termination hung on finalizer

Symptom. namespace stays Terminating.

Root cause. A controller may need to finish resource cleanup.

Broken example

bash
kubectl delete namespace preview-42 --wait=true

Corrected example

bash
kubectl get namespace preview-42 -o json | jq '{conditions:.status.conditions,finalizers:.spec.finalizers}'

Verification. Restore controller health and verify dependent resources before considering owner-approved recovery.

Correction validation syntax-validated.