How to sign in kubernetes dashboard?

后端 未结 9 2168
清酒与你
清酒与你 2020-12-07 07:01

I just upgraded kubeadm and kubelet to v1.8.0. And install the dashboard following the official document.

$ kubectl apply -f https://raw.githubusercontent.co         


        
9条回答
  •  猫巷女王i
    2020-12-07 07:31

    You need to follow these steps before the token authentication

    1. Create a Cluster Admin service account

      kubectl create serviceaccount dashboard -n default
      
    2. Add the cluster binding rules to your dashboard account

      kubectl create clusterrolebinding dashboard-admin -n default --clusterrole=cluster-admin --serviceaccount=default:dashboard
      
    3. Get the secret token with this command

      kubectl get secret $(kubectl get serviceaccount dashboard -o jsonpath="{.secrets[0].name}") -o jsonpath="{.data.token}" | base64 --decode
      
    4. Choose token authentication in the Kubernetes dashboard login page

    5. Now you can able to login

提交回复
热议问题