I installed kubernetes using kubeadm
. And to enable basic authentication, I added --basic-auth-file=/etc/kubernetes/user-password.txt
in my /etc/kubernetes/manifests/kube-apiserver.yaml
and also mounted corresponding volume of type "File" as described here
Basic auth works now, my question is how does kube-apiserver knows to automatically restart Pod after I edit /etc/kubernetes/manifests/kube-apiserver.yaml
on Kubernetes master host machine?
K8s control-plane components(apiserver,controller manager and scheduler) are static pods in the kube-system namespaces.
When you run following command
Kubeadm init
Generates static Pod manifests for the API server, controller manager and scheduler
Kubelet periodically scan all of these files.
Static Pod manifests are written to /etc/kubernetes/manifests; the kubelet watches this directory for Pods to create on startup.
I have attached the reference for further research