liveBook · Manning

Static pod

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A static pod is a Kubernetes pod created and managed directly by the kubelet from a local manifest rather than scheduled by the Kubernetes scheduler.

A static pod is created and managed by the kubelet from a local YAML manifest. Place a valid manifest in /etc/kubernetes/manifests/ on the control-plane node, and the kubelet automatically starts the pod without scheduler awareness. section 6.2.2 section 8.2

Use these operational distinctions when inspecting static pods:

  • Treat control-plane components such as the scheduler, controller manager, etcd, and API server as pods whose manifests reside in /etc/kubernetes/manifests/. section 8.2
  • Modify a system pod by changing its YAML manifest on the control-plane node; the kubelet detects valid files in the directory and runs them. section 9.3.1
  • Do not expect the scheduler to place these pods; scheduler failure prevents ordinary Deployment replicas from progressing beyond Pending. section 8.2

Troubleshoot a failed scheduler

Scale a Deployment from one to three replicas and inspect the pods. If the new replicas remain Pending, inspect the scheduler static pod with kubectl -n kube-system logs. An error such as "unknown flag: --kkubeconfig" indicates a malformed scheduler manifest or command. Correct the YAML in /etc/kubernetes/manifests/ and verify that the additional containers reach Running. section 8.2

root@kind-control-plane:/# curl 
https:/ /raw.githubusercontent.com/chadmcrowell/acing-the-cka-
exam/main/ch_08/kube-scheduler.yaml --silent --output 
/etc/kubernetes/manifests/kube-scheduler.yaml
root@kind-control-plane:/# kubectl scale deploy prod-app --replicas 3
deployment.apps/prod-app scaled
root@kind-control-plane:/# kubectl get po
NAME                        READY   STATUS    RESTARTS   AGE
prod-app-85c9dd4f9d-9clfl   0/1     Pending   0          7s
prod-app-85c9dd4f9d-l7fmj   1/1     Running   0          4m21s
prod-app-85c9dd4f9d-mbdk7   0/1     Pending   0          7s

Shows the observable result of disabling the scheduler: the original pod remains Running while two newly requested replicas remain Pending. section 8.2

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains the manifest location, kubelet ownership, scheduler exclusion, and a scheduler-failure troubleshooting workflow.
Examples
Demonstrates control-plane manifests and a broken scheduler that leaves newly scaled Deployment replicas Pending.
What it assumes
Assumes familiarity with pods, Deployments, control-plane components, kubelet operation, and basic kubectl inspection.
What you can do after
Diagnose static-pod failures with kubectl logs and repair control-plane components by correcting manifests in the kubelet directory.
How it connects
Connects static pods with the kubelet, Kubernetes scheduler, control plane, YAML manifests, and system pods.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.