<p>I'm trying to setup a cluster of one machine for now. I know that I can get the API server running and listening to some ports.</p>

<p>I am looking to issue commands against the master machine from my laptop.</p>

<p><code>KUBECONFIG=/home/slackware/kubeconfig_of_master kubectl get nodes</code> should send a request to the master machine, hit the API server, and get a response of the running nodes.</p>

<p>However, I am hitting issues with permissions. One is similar to <code>x509: certificate is valid for 10.61.164.153, not 10.0.0.1</code>. Another is a 403 if I hit the <code>kubectl proxy --port=8080</code> that is running on the master machine. </p>

<p>I think two solutions are possible, with a preferable one (B):</p>

<p>A. Add my laptop's ip address to the list of accepted ip addresses that API server or certificates or certificate agents holds. How would I do that? Is that something I can set in <code>kubeadm init</code>?</p>

<p>B. Add <code>127.0.0.1</code> to the list of accepted ip addresses that API server or certificates or certificate agents holds. How would I do that? Is that something I can set in <code>kubeadm init</code>?</p>

<p>I think B would be better, because I could create an ssh tunnel from my laptop to the remote machine and allow my teammates (if I ever have any) to do similarly.</p>

<p>Thank you,</p>

<p>Slackware</p>

Slackware
<p>You shoud add <code>--apiserver-cert-extra-sans 10.0.0.1</code> to your <code>kubeadm init</code> command.</p>

<p>Refer to <a href="https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#options" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#options</a></p>

<p>You should also use a config file:</p>

<pre><code>apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
kubernetesVersion: v1.16.2
apiServer:
  certSANs:
  - 10.0.0.1
</code></pre>

<p>You can find all relevant info here: <a href="https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2" rel="nofollow noreferrer">https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2</a></p>
