Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Copy the token and use it to log in at https://dashboard.da

Create a Secret Token (manually)


Create a ServiceAccount


Code Block
languageshell
titleShell Command
kubectl create serviceaccount dashboard-sa -n kubernetes-dashboard


Bind It to the Cluster Role (e.g. cluster-admin)


Code Block
languageshell
titleShell Command
kubectl create clusterrolebinding dashboard-sa-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-sa





Create a file dashboard-token.yaml:

Code Block
languageyaml
titleYAML MANIFEST
apiVersion: v1
kind: Secret
metadata:
  name: dashboard-sa-token
  namespace: kubernetes-dashboard
  annotations:
    kubernetes.io/service-account.name: dashboard-sa
type: kubernetes.io/service-account-token

...

Code Block
languageshell
titleShell Command
 kubectl apply -f dashboard-token.yaml




...

Wait & Retrieve the Token

It may take a few seconds for Kubernetes to populate the token. Then:

Code Block
languageshell
titleShell Command
kubectl -n kubernetes-dashboard describe secret dashboard-sa-token

...