# access PD Dashboard using port forwarding

If you or a customer are running a TiDB cluster in Kubernetes and it is not possible to access the PD Dashboard directly (there's no public/external endpoint for it), just use kubectl port-forward to forward to port 2379 of **one of the PD pods (not the PD service!)**.

Only the PD leader hosts the Dashboard, so depending on how support for proxying that changes, you might have to **forward directly to the PD leader pod** and **not** forward to the PD service.

Pick one of the PD pods, forward to it, and use **curl --head** to see if you got the right one. If not, the curl output will tell you which pod to use. If you are redirected to another pod, you'll need to re-create the port-forward.

Below is a sequence of commands to accomplish this:

```{.bash .copyable}
kubectl get po -n poc -l app.kubernetes.io/component=pd
```

```bash
  kubectl port-forward -n poc basic-pd-1 2381:2379 &
  $ curl --head 127.0.0.1:2381/dashboard/
  Handling connection for 2381
  **HTTP/1.1 307 Temporary Redirect**
  Access-Control-Allow-Headers: accept, content-type, authorization
  Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
  Access-Control-Allow-Origin: \*
  Content-Type: text/html; charset=utf-8
  Location: **http://basic-pd-0.basic-pd-peer.poc.svc:2379/dashboard/**
  Date: Thu, 27 Aug 2020 21:30:34 GMT
  ```

```bash
  kubectl port-forward -n poc basic-pd-0 2381:2379 &
  $ curl --head 127.0.0.1:2381/dashboard/
  Handling connection for 2381
  HTTP/1.1 405 Method Not Allowed
  Access-Control-Allow-Headers: accept, content-type, authorization
  Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
  Access-Control-Allow-Origin: \*
  Allow: GET
  Content-Type: text/plain; charset=utf-8
  X-Content-Type-Options: nosniff
  Date: Thu, 27 Aug 2020 21:31:10 GMT
  Content-Length: 45
  ```
