Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how does kube-apiserver restart after editing /etc/kubernetes/manifests/kube-apiserver.yaml

Tags:

kubernetes

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?

like image 663
bits Avatar asked Jan 03 '23 11:01

bits


1 Answers

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

kubeadm-init-workflow

like image 143
Suresh Vishnoi Avatar answered Jan 13 '23 15:01

Suresh Vishnoi