Skip to content

Commit

Permalink
Fix the instruction for accessing kubernetes dashboard
Browse files Browse the repository at this point in the history
The old way is not working as the dashboard is deployed in different
namespaces now.

Change-Id: I0ede1ffb43f1a5167dd7592eaa8ddc055282b9b7
  • Loading branch information
onstring committed Aug 25, 2024
1 parent 7a89d6b commit 62d1183
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions _kubernetes/03-administer-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,23 @@ Magnum also sets up the Kubernetes [Web
UI](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/)
by default. Follow these steps to access it.

1. Create a serviceaccount for `kubernetes-dashboard` namespace

```
kubectl create serviceaccount kubernetes-dashboard -n kubernetes-dashboard
```

1. Create a clusterrolebinding for the `kubernetes-dashboard` service account

```
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
kubectl create clusterrolebinding kubernetes-dashboard --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:kubernetes-dashboard
```

1. Get the dashboard token. Run the following code snippet, and copy the
resulting output to your clipboard
1. Get the dashboard token. Run the following code, and copy the resulting
output to your clipboard

```
SECRET_NAME=$(kubectl -n kube-system get secret | grep kubernetes-dashboard-token | cut -f1 -d ' ')
kubectl -n kube-system describe secret $SECRET_NAME | grep -E '^token' | cut -f2 -d':' | tr -d " "
kubectl create token kubernetes-dashboard -n kubernetes-dashboard
```

1. Use kubectl to create a web proxy
Expand All @@ -108,7 +113,7 @@ by default. Follow these steps to access it.
```

1. Using a browser, visit the dashboard URL. The URL is
[http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/](http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/)
[http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:443/proxy/](http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:443/proxy/)

1. Select the `token` option, and paste the token you copied into the field
provided. Click login and you should be taken to an overview of your cluster.

0 comments on commit 62d1183

Please sign in to comment.