Skip to main content
All of the catalog
Injectable fault

Missing Secret key: pods that never start

go-api is completely down and every request fails. Two routine jobs ran overnight: the credential rotation, and a node rotation that replaced every pod. No new pod has started since: they are all stuck before their container runs, so there are no logs and no restarts. Nothing was deployed, and unlike a crash loop the app never gets far enough to fail.

ConfigHigh severitygo-api/go-api
Definition on GitHub

Which app it breaks

go-api by default. Pass --app to break another app in your lab instead.

The hint ladder

Each hint narrows the search a little further. They are collapsed on purpose: open one only when you are properly stuck, because working out the next command yourself is the whole exercise.

Hint 1

Start from the pods: kubectl get pods -n go-api. Read STATUS: is any container running at all? A pod whose container never started has no logs to read, so kubectl logs tells you nothing here.

Hint 2

CreateContainerConfigError means the kubelet could not build the container's configuration, so it never started it. kubectl describe pod -n go-api <pod> says why in the Events at the bottom. Restarting the Deployment builds new pods from the same configuration, and they stop in the same place.

Hint 3

The container reads some of its environment from a Secret, one key at a time (env[].valueFrom.secretKeyRef in kubectl get deploy go-api -n go-api -o yaml). Compare the key it asks for with the keys the Secret has: kubectl describe secret -n go-api <secret> lists them.

Further reading

Get updates

New scenarios and faults, release notes, and news about hosted labs if and when there is some. A few emails a month at most.

We'll email you about new releases, new lab content and paid offerings such as hosted labs, courses and workshops. Unsubscribe any time.