<p>I installed first ectd, kubeapiserver and kubelet using systemd service. The services are running fine and listening to all required ports.</p>

<p>When I run kubectl cluster-info , I get below output</p>

<pre><code>Kubernetes master is running at http://localhost:8080
</code></pre>

<p>When I run kubectl get componentstatuses, then I get below output</p>

<pre><code>etcd-0               Healthy     {"health": "true"}
</code></pre>

<p>But running kubectl get nodes , I get below error</p>

<pre><code>Error from server (ServerTimeout): the server cannot complete the requested operation at this time, try again later (get nodes)
</code></pre>

<p>Can anybody help me out on this.</p>

Rehan Ch
<p>For the message:</p>
<pre><code>:~# k get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS      MESSAGE                                                                                       ERROR
controller-manager   Unhealthy   Get &quot;http://127.0.0.1:10252/healthz&quot;: dial tcp 127.0.0.1:10252: connect: connection refused   
scheduler            Unhealthy   Get &quot;http://127.0.0.1:10251/healthz&quot;: dial tcp 127.0.0.1:10251: connect: connection refused   
etcd-0               Healthy     {&quot;health&quot;:&quot;true&quot;} 
--------
</code></pre>
<p>Modify the following files on all master nodes:</p>
<pre><code>$ sudo vim /etc/kubernetes/manifests/kube-scheduler.yaml
</code></pre>
<p>Comment or delete the line:</p>
<pre><code>- --port=0
</code></pre>
<p>in (spec-&gt;containers-&gt;command-&gt;kube-scheduler)</p>
<pre><code>$ sudo vim /etc/kubernetes/manifests/kube-controller-manager.yaml
</code></pre>
<p>Comment or delete the line:</p>
<pre><code>- --port=0
</code></pre>
<p>in (spec-&gt;containers-&gt;command-&gt;kube-controller-manager)</p>
<p>Then restart kubelet service:</p>
<pre><code>$ sudo systemctl restart kubelet.service
</code></pre>
