<p>Deleting kube-apiserver from kubernetes-master  does not prevent kubectl from querying pods. I always understand, kube-apiserver is responsible for communication with the master.</p>
<p>My question: how can kubectl still able to query pods while kube-apiserver is still restarting? Is there any official documentation that covers this behavior?</p>
<p><a href="https://i.stack.imgur.com/hG60M.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hG60M.png" alt="enter image description here" /></a></p>

kaleb
<p>Your understanding is correct. The <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/" rel="nofollow noreferrer">Kubernetes API</a> server validates and configures data for the api objects which include pods, services, replication controllers, and others. The API Server services REST operations and provides the frontend to the cluster's shared state through which all other components interact. So if your <code>api-server</code> pod will encounter some issues you will not be able to get your client communicating with it.</p>
<p>What is happening is that when you delete the <code>api-server</code> pod it is being immediately recreated hence your client is able to connect and fetch the data.</p>
<p>To provide an example I have simulated the api-server pod failure by fiddling a bit with <code>kube-apiserver.yaml</code> file in the <code>/etc/kubernetes/manifests</code>:</p>
<pre class="lang-sh prettyprint-override"><code>➜  manifests pwd                 
/etc/kubernetes/manifests
</code></pre>
<p>Immediately once a did that I was no longer able to connect to <code>api-server</code>:</p>
<pre class="lang-py prettyprint-override"><code>➜  manifests kubectl get pods -A        
The connection to the server 10.128.15.230:6443 was refused - did you specify the right host or port?
</code></pre>
<p>Getting those manifest in docker desktop could be tricky depends where you run it. Please have a look at <a href="https://stackoverflow.com/questions/64758012/location-of-kubernetes-config-directory-with-docker-desktop-on-windows">this</a> case where answer show solution to that.</p>
