Tanumoy Ghosh:
Require clarification on staticPodPath
where the yaml files need to be placed to spin up static pods
As per static pod lecture, it says in kubelet.service either we should expect --pod-manifest-path
or, --config
; whose value would actually point to the path to place the yamls
In kodekloud lab, when I tried to find the path via kubelet.service I could not track either of the above two fields, does the convention get changed over time ??
# service kubelet status
...
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
# cat /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=<https://kubernetes.io/docs/home/>
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=multi-user.target
In solution video, it has been shown to find out via ps -ef | grep kubelet | grep config
Mayur Sharma:
@Tanumoy Ghosh When you check the status of service, it shows its loaded path and where it’s configuration file is present.
Path is somewhat like /etc/system/system.d/net.d (please confirm the path from status o/p)
Open that configuration file, you will see how the kubelet service is running with all the parameters.
Check --config parameter, open this file and
look for staticPodPath property and this is the place where kubelet watches for static pods.
hope its clear now
Tanumoy Ghosh:
So this is the entire output of the command
# service kubelet status
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/kubelet.service.d
└─10-kubeadm.conf
Active: active (running) since Fri 2021-06-04 07:00:18 UTC; 7min ago
Docs: <https://kubernetes.io/docs/home/>
Main PID: 4986 (kubelet)
Tasks: 43 (limit: 7372)
CGroup: /system.slice/kubelet.service
└─4986 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/
Jun 04 07:00:51 controlplane kubelet[4986]: W0604 07:00:51.746898 4986 cni.go:239] Unable to update cni config:
........
Tanumoy Ghosh:
And if I search for the kubelet.service file, getting multiple results
# sudo find / -name "kubelet.service"
/var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/kubelet.service
/etc/systemd/system/multi-user.target.wants/kubelet.service
find: '/proc/tty/driver': Permission denied
/lib/systemd/system/kubelet.service
find: '/sys/kernel/slab/dentry/cgroup/dentry(17102469:57e78b87134d518350daec8fb4dbe6b9d352ae0fd21cde41e121e449dceb6d8a)': No such file or directory
/sys/fs/cgroup/devices/system.slice/kubelet.service
/sys/fs/cgroup/memory/system.slice/kubelet.service
/sys/fs/cgroup/pids/system.slice/kubelet.service
/sys/fs/cgroup/cpu,cpuacct/system.slice/kubelet.service
/sys/fs/cgroup/blkio/system.slice/kubelet.service
/sys/fs/cgroup/systemd/system.slice/kubelet.service
Mayur Sharma:
Service file path is given in first command only, no need to search
# service kubelet status
● kubelet.service - kubelet: The Kubernetes Node Agent
Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
Next, go to cd /lib/systemd/system/kubelet.service
Tanumoy Ghosh:
Re-pasting the output (couldn’t find neither --pod-manifest-path
nor --config
)
# cat /lib/systemd/system/kubelet.service
[Unit]
Description=kubelet: The Kubernetes Node Agent
Documentation=<https://kubernetes.io/docs/home/>
Wants=network-online.target
After=network-online.target
[Service]
ExecStart=/usr/bin/kubelet
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=multi-user.target