<p>I am trying to access the kubernetes Dashboard using the config file. From the authentication when I select config file its giving ‘<code>Not enough data to create auth info structure</code>.’  Bu the same config file work for kubectl command.</p>

<p><a href="https://i.stack.imgur.com/VEzb9.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VEzb9.png" alt="enter image description here"></a></p>

<p>here is my config file.</p>

<pre><code>apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: REDACTED
    server: https://kubemaster: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
</code></pre>

<p>Any help to resolve this issue?</p>

<p>Thanks
SR</p>

<p>After looking at this answer <a href="https://stackoverflow.com/questions/46664104/how-to-sign-in-kubernetes-dashboard">How to sign in kubernetes dashboard?</a> and source code figured the kubeconfig authentication.</p>

<p>After kubeadm install on the master server get the <strong>default</strong> service account token and add it to config file. Then use the config file to authenticate.</p>

<p>You can use this to add the token.</p>

<pre><code>#!/bin/bash
TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}')

kubectl config set-credentials kubernetes-admin --token="${TOKEN}"
</code></pre>

<p>your config file should be looking like this.</p>

<pre><code>kubectl config view |cut -c1-50|tail -10
  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: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.ey
</code></pre>
