<p>I installed kubernetes using <code>kubeadm</code>. And to enable basic authentication, I added <code>--basic-auth-file=/etc/kubernetes/user-password.txt</code> in my <code>/etc/kubernetes/manifests/kube-apiserver.yaml</code> and also mounted corresponding volume of type "File" as described <a href="https://stackoverflow.com/questions/46618383/how-to-config-simple-login-pass-authentication-for-kubernetes-desktop-ui">here</a></p>

<p>Basic auth works now, my question is how does kube-apiserver knows to automatically restart Pod after I edit <code>/etc/kubernetes/manifests/kube-apiserver.yaml</code> on Kubernetes master host machine?</p>

<p>K8s control-plane components(apiserver,controller manager and scheduler) are <strong>static pods</strong> in the kube-system namespaces. </p>

<p>When you run following command </p>

<pre><code>Kubeadm init
</code></pre>

<blockquote>
  <p>Generates static Pod manifests for the API server, controller manager and scheduler</p>
</blockquote>

<p>Kubelet periodically scan all of these files.</p>

<blockquote>
  <p>Static Pod manifests are written to /etc/kubernetes/manifests; the kubelet watches this directory for Pods to create on startup.</p>
</blockquote>

<p>I have attached the reference for further research</p>

<p><a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#init-workflow" rel="noreferrer">kubeadm-init-workflow</a> </p>
