<p>I've set up an insecure k8s master node using <code>hyperkube</code>, with an insecure API:</p>

<pre class="lang-sh prettyprint-override"><code>docker run -d --name=k8s-apiserver --net=container:etcd gcr.io/google_containers/hyperkube:v1.8.5 /apiserver --etcd-servers=http://127.0.0.1:2378 --service-cluster-ip-range=10.0.0.1/24 --insecure-bind-address=0.0.0.0 --insecure-port=8080 --admission-control=AlwaysAdmit
</code></pre>

<p>Moving on to configuring the nodes, what option to the <code>docker run -d --name=kubelet gcr.io/google_containers/hyperkube:v1.8.5 /kubelet</code> command points <code>kubelet</code> to the master <code>apiserver</code>? I can't seem to find this option using <code>--help</code>.</p>

<p>Starting from kubernetes version 1.8 you should use <code>--kubeconfig</code> key to specify a path to a <code>kubeconfig</code> file where is described how to connect to API server: </p>

<pre><code>--kubeconfig string      Path to a kubeconfig file, specifying how to connect to the API server. (default "/var/lib/kubelet/kubeconfig")
</code></pre>

<p>where <code>/var/lib/kubelet/kubeconfig</code> something like:</p>

<pre><code>apiVersion: v1
clusters:
- cluster:
    certificate-authority: ~/.kube/ca.crt
    server: https://&lt;API_IP&gt;:&lt;API_PORT&gt;
  name: dev
contexts:
- context:
    cluster: dev
    user: dev
  name: dev
current-context: dev
kind: Config
preferences: {}
users:
- name: dev
  user:
    as-user-extra: {}
    client-certificate: ~/.kube/client.crt
    client-key: ~/.kube/client.key
</code></pre>

<p>So, finally you should just mount the config file inside <code>kubelet</code> docker container:</p>

<pre><code>docker run -d -v /var/lib/kubelet/kubeconfig:/var/lib/kubelet/kubeconfig --name=kubelet gcr.io/google_containers/hyperkube:v1.8.5 /kubelet
</code></pre>
