<p>I have a single master, multinode kubernetes going. It works great. However I want to allow kubectl commands to be run from outside the master server. How do I run kubectl get node from my laptop for example?</p>

<p>If I install kubectl on my laptop I get the following error:
error: client-key-data or client-key must be specified for kubernetes-admin to use the clientCert authentication method</p>

<p>How do I go about this. I have read through the kubernetes authorisation documentation but I must say it's a bit greek to me. I am running version 1.10.2.</p>

<p>Thank you. </p>

warhansen
<p>To extend  <a href="https://stackoverflow.com/users/344669/sfgroups">@sfgroups</a> answer:</p>

<p>Configurations of all <a href="https://kubernetes.io/" rel="nofollow noreferrer">Kubernetes</a> clusters you are managing
are stored in $HOME/.kube/config file. If you have that file on the master node,
the easy way is to copy it to $HOME/.kube/config file on a local machine.
You can choose other places, and then specify the location by environment value <code>KUBECONFIG</code>:</p>

<pre><code>export KUBECONFIG=/etc/kubernetes/config
</code></pre>

<p>or use <code>--kubeconfig</code> command line parameter instead.</p>

<p>Cloud providers often give you a possibility to download config to local machine from the
web interface or by the cloud management command. </p>

<p>For <a href="https://cloud.google.com/" rel="nofollow noreferrer">GCP</a>:</p>

<p><code>gcloud container clusters get-credentials NAME [--region=REGION     | --zone=ZONE, -z ZONE] [GCLOUD_WIDE_FLAG …]</code></p>

<p>For <a href="https://azure.microsoft.com/en-us/" rel="nofollow noreferrer">Azure</a>:</p>

<pre><code>az login -u yourazureaccount -p yourpassword
az acs kubernetes get-credentials --resource-group=&lt;cluster-resource-group&gt; --name=&lt;cluster-name&gt;
</code></pre>

<p>If the cluster was created using <a href="https://github.com/kubernetes/kops" rel="nofollow noreferrer">Kops</a> utility, you could get the config file by:</p>

<pre><code>kops export kubeconfig ${CLUSTER_NAME}
</code></pre>
