Problem
- Various Errors encountered while trying to access the Kubernetes dashboard after deploying a PMK cluster.
- The following are the common error codes - 404(not Found), 403(forbidden), and 500(server error).
Environment
- Platform9 Managed Kubernetes - v4.0 and higher
- PMKFT
- Kubernetes Dashboard
Cause
There can be multiple causes for being unable to access the Kubernetes dashboard. The most common ones include not having the correct clusterrolebinding in place or the dashboard pod stuck in an error state.
Resolution
- Create a clusterrolebinding between cluster-admin clusterrole and one serviceaccount in any namespace(you can use Kubernetes dashboard service account within the Kubernetes dashboard namespace or you can create a new one).
- Use the token from the secret passed in this serviceaccount to access the dashboard. To ensure the correct token is used run the below command to get an encoded token from the secret.
# kubectl get secret <secret name from serviceaccount> -o jsonpath="{.data.token}" | base64 --decode && echo ''
- You can get error 500 connecting to the dashboard because of stale cookies if the old instance of the dashboard you connected to was stopped, try accessing the dashboard from a fresh browser window or try using an incognito window.