<p>kubectl get pods -o wide --all-namespaces</p>

<p>it gives kubectl get nodes returns 'The connection to the server 10.xxxxxxxxx was refused. did you specify right host or port?'</p>

<p>kindly do guide.</p>

<p>thanks</p>

user10478566
<p>It seems your kubeconfig is not correct after doing kubeadm init, you didnt do the below steps.</p>

<pre><code>Your Kubernetes master has initialized successfully!
To start using your cluster, you need to run (as a regular user):
sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf
</code></pre>

<p>Try it and check </p>

<p>If you are on GKE try doing below steps to autogenerate kubeconfig</p>

<pre><code>gcloud container clusters get-credentials "CLUSTER NAME"
</code></pre>
