1) How many static pods exist in the cluster (across all namespaces)?
First, list all pods across all namespaces:kube-apiserver-controlplane). To confirm, inspect the pod YAML and examine the ownerReferences field. If the owner kind is Node, the pod is a static pod created by the kubelet.
Inspect the kube-apiserver pod (namespace kube-system):
controlplane node:
- etcd
- kube-apiserver
- kube-controller-manager
- kube-scheduler
Tip: static pods are created and managed by the kubelet from manifest files on the node’s filesystem. Always check the
ownerReferences field — kind: Node indicates a static pod.2) Which components are not deployed as static pods?
From the pod list above:- Not static: CoreDNS, kube-proxy (deployed via Deployment / DaemonSet)
- Static: etcd, kube-apiserver, kube-controller-manager, kube-scheduler
3) On which node(s) are the static pods created?
The static pods include the node name in their resource name and theownerReferences shows name: controlplane, so they are created on the controlplane node.
4) What is the path of the directory holding the static pod manifest files?
The kubelet configuration specifies the static pod manifest path. Inspect the kubelet config file:staticPodPath setting in the KubeletConfiguration:
/etc/kubernetes/manifests (unless your kubelet config uses a different path).
5) How many pod definition files are present in the manifests folder?
Listing the manifest directory shows four files:- etcd.yaml
- kube-apiserver.yaml
- kube-controller-manager.yaml
- kube-scheduler.yaml
/etc/kubernetes/manifests — matching the four static pods observed.
You can summarize static vs non-static components:
6) What Docker image is used to deploy the kube-apiserver static pod?
Inspect the kube-apiserver manifest or the pod YAML to read the image field. Example excerpt fromkube-apiserver.yaml:
7) Create a static pod named static-busybox using the busybox image and the sleep command
To create a static pod, generate a pod manifest and place it in the kubelet’s staticPodPath. Do not use kubectl create directly against the API for this purpose. Use kubectl run to generate the YAML and redirect to a file:
Important: put kubectl options before the -- and the container command after --.
static-busybox.yaml, for example:
static-busybox-controlplane:
8) Change the image used by the static pod to busybox:1.28.4
Edit the manifest file on the node at /etc/kubernetes/manifests/static-busybox.yaml and update the image field:
ErrImagePull or ImagePullBackOff. Eventually the pod should transition to Running:
Always verify the pod’s final state after editing static pod manifests. A mistyped image name or tag causes image pull failures and pod restart loops.
9) Remove a static pod named static-greenbox
Deleting the Pod resource with kubectl delete pod is temporary for static pods because the kubelet recreates them from the manifest. To permanently remove a static pod, delete its manifest file from the node’s static pod path.
Example flow:
- Confirm the pod location and node:
- SSH to the node (or access it directly):
- Check kubelet’s
staticPodPath(if not default):
/etc/just-to-mess-with-you used in the lab.)
- Inspect the manifest directory and remove the manifest:
- Back on the control plane, observe the pod terminating and disappearing once the kubelet stops recreating it:
Warning: Removing or modifying static pod manifests directly affects the node and the cluster control plane. Only delete or change manifest files when you intend to permanently remove or modify the static pod.
This completes the walkthrough: identifying static pods, locating the kubelet static pod manifest path, creating and editing a static pod manifest, and permanently removing a static pod by deleting its manifest on the node.