title: How to add more nodes in the self signed certificate of Kubernetes Dashboard
body: <p>I finally managed to resolve my question related to how to add more nodes in the CAs of the Master nodes (<a href="https://stackoverflow.com/questions/65186710/how-to-add-extra-nodes-to-the-certificate-authority-data-from-a-self-signed-k8s/65198463?noredirect=1#comment115265632_65198463">How to add extra nodes to the certificate-authority-data from a self signed k8s cluster?</a>).</p>
  <p>Now the problem that I am facing is I want to use kubeconfig file e.g. <code>~/.kube/config</code> to access the Dashboard.</p>
  <p>I managed to figured it out by having the following syntax:</p>
  <pre class="lang-sh prettyprint-override"><code>$ kubectl config view
  apiVersion: v1
  clusters:
  - cluster:
      certificate-authority-data: DATA+OMITTED
      server: https://IP:6443
    name: kubernetes
  contexts:
  - context:
      cluster: kubernetes
      user: kubernetes-admin
    name: kubernetes-admin@kubernetes
  current-context: kubernetes-admin@kubernetes
  kind: Config
  preferences: {}
  users:
  - name: kubernetes-admin
    user:
      client-certificate-data: REDACTED
      client-key-data: REDACTED
      token: REDACTED
  </code></pre>
  <p>The problem that I am having is that I need to use the IP of one of the Master nodes in order to be able to reach the Dashboard. I would like to be able to use the LB IP to reach the Dashboard.</p>
  <p>I assume this is related to the same problem that I had before as I can see from the file that the CAs are autogenerated.</p>
  <pre class="lang-sh prettyprint-override"><code>args:
    - --auto-generate-certificates
    - etc etc
    .
    .
    .
  </code></pre>
  <p>Apart from creating the CAs on your self in order to use them is there any option to pass e.g. IP1 / IP2 etc etc in a flag within the file?</p>
  <p><strong>Update:</strong> I am deploying the Dashboard through the recommended way <code>kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml</code> (<a href="https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/" rel="nofollow noreferrer">Deploying the Dashboard UI</a>). The deployment is on prem but I have configured the cluster with an external loadbalancer (HAProxy) towards the Api and also Ingress and also <code>type: LoadBalancer</code> on Ingress. Everything seems to working as expected apart from the Dashboard UI (through LB IP). I am also using authentication mode <code>authorization-mode: Node,RBAC</code> on the kubeconfig file (if relevant).</p>
  <p>I am access the Dashboard through Inress HTTPS e.g. <code>https://dashboard.example.com</code>.</p>
  <p>I get the error <code>Not enough data to create auth info structure</code>. Found the <code>token: xxx</code> solution from this question <a href="https://stackoverflow.com/questions/48228534/kubernetes-dashboard-access-using-config-file-not-enough-data-to-create-auth-inf">Kubernetes Dashboard access using config file Not enough data to create auth info structure.</a>.</p>
  <p>If I switch the LB IP with the Master nodes then I can access the UI with the kubeconfig file.</p>
  <p>I just updated now to the latest version of the dashboard v2.0.5 is not working with the kubeconfig button / file but it works with the token directly <a href="https://github.com/kubernetes/dashboard/releases/tag/v2.0.5" rel="nofollow noreferrer">kubernetes/Dashoboard-v2.0.5</a>. With the previous version everything works as described above. No error logs in the pod logs.</p>