Contents

Kubernetes Static Pod

Static PODs vs DaemonSets

Static PODsDaemonSets
Created by kubeletCreated by kube-api server (DaemonSet Controller)
Deploy Control Plane components as Static PODsDeploy Monitoring Agents, Logging Agents on Nodes
Ignore kube-schedulerIgnore kube-scheduler

Default Static PODs Location

Static PODs
When created or deleted a YAML file in the /etc/kubernetes/manifests, the PODs will be created or deleted automatically.
1
cd /etc/kubernetes/manifests

Check How many PODs exist in the Node

1
ls /etc/kubernetes/manifests

Imperative

1
kubectl run --restart=Never --image=nginx --dry-run=client -o yaml --command sleep 1000 > /etc/kubernetes/manifests/nginx.yaml

Check Static PODs Configuration

Find a Node of the POD

How to figure out it's a static POD?
In a POD’s name, there is a postfix like -master that is -<node-name>.
1
2
3
kubectl get pods -o wide

kubectl get pods --all-namespaces -o wite | grep "\-master"

Connect to the Node

1
ssh <node-name>

Find the Location of the Configuration

1
2
# Check '--config' option
ps -ef | grep kubelet

Check staticPodPath Option

1
2
# Check 'staticPodPath'
grep -i staticpod /var/lib/kubelet/config.yaml