<p>I have installed k8s on a bare metal cluster using <code>kubeadm init</code>.</p>
<p>Next I need to setup remote access for <code>kubectl</code>.  i.e. using <code>kubectl</code> from your laptop to access the remote cluster.</p>
<p>How do I setup the cluster, context, and credentials?</p>

<p>You can use these commands to set the cluster, context, and credentials individually:</p>
<pre><code>kubectl config set-cluster
kubectl config set-context
kubectl config set-credentials
</code></pre>
<p>If your not certain about the parameters to use for the credentials, i.e. client key/certs, its easier to copy the same exact credentials over to your cluster:</p>
<pre><code>scp &lt;username&gt;@&lt;master-node-ip&gt;:/home/&lt;username&gt;/.kube/config ~/.kube/config
</code></pre>
<p><strong>Warning</strong>: above command will overwrite any existing kube config file.  If so, its best to copy/paste over only the clusters, contexts, and credentials that you need to your local kube config file.</p>
<p>I found the kube config on the cluster already has the right keys and certificates.</p>
