Skip to content

A pod will not start ​

kubectl get pods shows you which of the three you have. They fail at different stages, which is useful: the state alone tells you how far the pod got.

bash
kubectl get pods
kubectl describe pod <name>

describe first, always. The events at the end of its output usually name the reason outright.

Pending ​

The pod exists but has not been placed on a node. It never started, so there are no logs to read.

A full quota never shows up as Pending: a pod that does not fit the quota is refused before it exists, see exceeded quota. That leaves two causes, both visible in describe:

  • It is waiting for a node. When no node has room, the cluster adds one, and the pod stays Pending until that node is ready.
  • A PVC it mounts has not bound yet, see Storage and cost surprises.

exceeded quota ​

text
Error from server (Forbidden): error when creating "app.yaml": pods "big" is forbidden: exceeded quota: tenant-quota, requested: limits.cpu=40,requests.cpu=40, used: limits.cpu=4100m,requests.cpu=850m, limited: limits.cpu=32,requests.cpu=32

Your namespace quota is checked when a pod is created, so a pod that does not fit is never created at all. Applied directly, it fails with the message above. Created by a Deployment, Job or CronJob, no pod appears and kubectl get pods shows nothing new: the same message sits on the controller as a FailedCreate event instead.

bash
kubectl get events --field-selector reason=FailedCreate
kubectl get resourcequota -o yaml

Compare used against limited in the message. The quota counts the requests and limits your pods declare, not what they consume, and a container that declares none still gets a default, so a namespace can be full while its applications sit quiet. A pod that asks for more than the whole quota never fits. Otherwise nothing more fits until something else stops or you move to a larger plan; you cannot raise the quota yourself. See Billing and quotas.

ImagePullBackOff ​

The pod was placed, but the image could not be pulled. describe names the registry and the reason.

For a private registry, the credentials are missing or wrong. Your namespace usually has a pull secret already; check:

bash
kubectl get secret itsh-registry

If it is there, reference it in the pod template, which is not automatic:

yaml
spec:
  imagePullSecrets:
    - name: itsh-registry

If it is missing, create one of type kubernetes.io/dockerconfigjson with a registry token from the portal.

For a public registry, it is nearly always the tag or the spelling. A tag that does not exist and a typo in the repository name produce the same manifest unknown.

On the free tier, remember that outbound traffic is limited to HTTP and HTTPS. Registries use HTTPS, so pulls work, but a registry on a non-standard port does not.

CrashLoopBackOff ​

The container starts and exits, repeatedly, with a growing delay between attempts. This is the friendliest of the three: it means scheduling and image pull both worked, so the problem is inside your application or its configuration.

The current log is from the newest attempt. To see the one that actually failed:

bash
kubectl logs deployment/<name> --previous

Common causes, in rough order:

  • A missing environment variable or secret. The application exits on startup. The log usually says which one.
  • It cannot reach its database. On the free tier, check that the database is inside your namespace: outbound connections on database ports do not work there, see Outbound connections fail.
  • It was killed for using too much memory. describe shows Last State: Terminated with Reason: OOMKilled. Raise the memory limit, and remember a container that declares none is capped at a small default.
  • A liveness probe is failing. The application is fine but too slow to answer during startup, so it gets killed and restarted forever. Raise initialDelaySeconds, or use a startup probe.
  • The container exits cleanly. Exit code 0 still restarts, because the default restart policy does not care why it stopped. A container that runs a task and finishes belongs in a Job, not a Deployment.

What's next ​