Kubernetes Dashboard access using config file Not enough data to create auth info structure.

前端 未结 8 1578
暖寄归人
暖寄归人 2020-12-08 04:14

I am trying to access the kubernetes Dashboard using the config file. From the authentication when I select config file its giving ‘Not enough data to create auth info

8条回答
  •  心在旅途
    2020-12-08 04:43

    1 - Assuming one has followed the directions to setup the dashboard here. https://docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html

    2 - And your normal kubectl access works from the command line (i.e. kubectl get services).

    3 - And you are able to login manually to the Dashboard with the token (with kubectl -n kube-system describe secret ...), by using copy/paste.

    4 - But now you want to use the "Kubeconfig" (instead of "Token") option to login to the Dashboard, for simplicity.

    Solution:

    • Find your user in the config file, that is used to access the cluster.
    • The user is "kubernetes-admin" in this original posted question.
    • Add a line with the "token:".
    • Dont forget this is YAML, so use spaces, not tabs.

    Here is what it should look like...

    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
        token: PUT_YOUR_TOKEN_HERE_THAT_YOU_USED_TO_MANUALLY_LOGIN
    

提交回复
热议问题