<p>The Google cloud SDK console showing &quot;Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.&quot; below error when I'm trying to run kubectl commands</p>
<p><a href="https://i.stack.imgur.com/nbIYl.png" rel="nofollow noreferrer">click here to view image</a></p>

harish hari
<p>This error indicates that your <code>kubeconfig</code> is not correct.</p>
<p>In order to use connect to cluster you can run:</p>
<pre><code>gcloud container clusters list
</code></pre>
<p>to get the name of your cluster and then run:</p>
<pre><code>gcloud container clusters get-credentials &lt;cluster-name&gt;
</code></pre>
<p>to generate <code>kubeconfig</code> for chosen cluster.</p>
