...
Copy the token and use it to log in at https://dashboard.da
Create a Secret Token (manually)
Create a ServiceAccount
| Code Block |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl create serviceaccount dashboard-sa -n kubernetes-dashboard |
Bind It to the Cluster Role (e.g. cluster-admin)
| Code Block |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl create clusterrolebinding dashboard-sa-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-sa |
Create a file dashboard-token.yaml:
| Code Block |
|---|
| language | yaml |
|---|
| title | YAML 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 |
|---|
| language | shell |
|---|
| title | Shell 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 |
|---|
| language | shell |
|---|
| title | Shell Command |
|---|
|
kubectl -n kubernetes-dashboard describe secret dashboard-sa-token |
...