# Unable to Access Kubernetes Dashboard After Creating PMK Cluster

## 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
* 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

1. 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).

{% tabs %}
{% tab title="None" %}

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

{% endtab %}
{% endtabs %}

2. 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.

{% tabs %}
{% tab title="None" %}

```none
# kubectl get secret [secret name from serviceaccount] -o jsonpath="{.data.token}" | base64 --decode && echo ''
```

{% endtab %}
{% endtabs %}

3. 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.
