<h1>Symptom:</h1>
<p>When we install the new kubernetes cluster. When we execute the following command:</p>
<pre><code>$ kubectl get cs / kubectl get componentstatuses
</code></pre>
<p>we get this error:</p>
<pre><code>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>

Mohammad Shafiee
<h1>Solution:</h1>
<p>Modify the following files on all master nodes:</p>
<pre><code>$ sudo vi /etc/kubernetes/manifests/kube-scheduler.yaml
</code></pre>
<p>Clear the line (spec-&gt;containers-&gt;command) containing this phrase: - --port=0</p>
<pre><code>$ sudo vi /etc/kubernetes/manifests/kube-controller-manager.yaml
</code></pre>
<p>Clear the line (spec-&gt;containers-&gt;command) containing this phrase: - --port=0</p>
<pre><code>$ sudo systemctl restart kubelet.service
</code></pre>
<h1>Another reason for this problem:</h1>
<p>You may have used http_proxy in the docker setting. In this case, you must set address of the master nodes addresses in no_proxy</p>
