<p>I am unable to install kubectl on AWS ec2 instance(Amazon ami and ubuntu). </p>

<p>After installing kops and kubectl tried to check the version of kubectl but it is throwing the error:</p>

<pre><code>The connection to the server localhost:8080 was refused - did you specify the right host or port?
</code></pre>

<p>I have already opened the ports, but still, I'm getting the same error. </p>

<p>I have installed Minikube also, but still, I am facing the same issue.</p>

<p>This is because your <code>~/.kube/config</code> file is not correct. Configure it correctly so that you can connect to your cluster using <code>kubectl</code>.</p>
