<p>I want to point my machine's kubectl to a cluster running on EC2 instances.</p>
<p>When using EKS, it's fairly easy, we just need to run:</p>
<pre class="lang-bash prettyprint-override"><code>aws eks --region=&lt;REGION&gt; update-kubeconfig --name &lt;CLUSTER_NAME&gt;
</code></pre>
<p>However, how can I get the same behaviour if my master-nodes and worker-nodes are hosted on EC2 instances directly?</p>

Alex
<p>Firstly download your cluster config from master node to your machine. Then you need to merge downloaded config with your existing config on your local.</p>
<p><a href="https://medium.com/@jacobtomlinson/how-to-merge-kubernetes-kubectl-config-files-737b61bd517d" rel="nofollow noreferrer">This</a> post will help you how to merge them.</p>
<p>Then you can manage your configs with <a href="https://github.com/ahmetb/kubectx" rel="nofollow noreferrer">kubectx</a>.</p>
