rook: Could not access Ceph dashboard

Is this a bug report or feature request?

  • Bug Report

Deviation from expected behavior: using https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/cluster.yaml which enabled dashboard default but I cannot access ceph dashboard when port-forward or even exec into container :

$ kubectl -n rook-ceph exec -ti rook-ceph-mgr-a-976ccf6b9-k44xc bash [root@rook-ceph-mgr-a-976ccf6b9-k44xc /]# curl -k https://localhost:8443 curl: (7) Failed connect to localhost:8443; Connection refused

$ kubectl -n rook-ceph port-forward rook-ceph-mgr-a-976ccf6b9-7vrvn 8443 Forwarding from 127.0.0.1:8443 -> 8443 Forwarding from [::1]:8443 -> 8443 Handling connection for 8443 E0121 17:32:25.239419 16315 portforward.go:331] an error occurred forwarding 8443 -> 8443: error forwarding port 8443 to pod c7b923f23b29f2331dbb019ebd89a433338db17b1fd2514e4743bb607a85f63f, uid : exit status 1: 2019/01/21 10:32:25 socat[11551] E connect(5, AF=2 127.0.0.1:8443, 16): Connection refused

Expected behavior:

Could access ceph-dashboard

How to reproduce it (minimal and precise):

helm install --wait -n rook --namespace rook-ceph-system rook-stable/rook-ceph

kubectl apply -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/cluster.yaml

then try to access Ceph dashboard

Environment:

  • OS (e.g. from /etc/os-release): Ubuntu
  • Kernel (e.g. uname -a):
  • Cloud provider or hardware configuration: AWS
  • Rook version (use rook version inside of a Rook Pod): rook-ceph-v0.9.1
  • Kubernetes version (use kubectl version): 1.11.6
  • Kubernetes cluster type (e.g. Tectonic, GKE, OpenShift): Kops
  • Storage backend status (e.g. for Ceph use ceph health in the Rook Ceph toolbox):

kubectl -n rook-ceph exec rook-ceph-tools-b5759df6b-6tq5d – ceph health detail HEALTH_OK

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 16
  • Comments: 24 (6 by maintainers)

Most upvoted comments

You can also access the dashboard using kubectl proxy and an apiserver proxy URL:

  • run
$ kubectl proxy
Starting to serve on 127.0.0.1:8001
  • open http://localhost:8001/api/v1/namespaces/rook-ceph/services/https:rook-ceph-mgr-dashboard:https-dashboard/proxy/ in the browser.

Maybe check this: https://github.com/rook/rook/issues/2492#issuecomment-465543730 It may help…

In short:

kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') -- ceph config set mgr mgr/dashboard/server_addr 0.0.0.0

kubectl delete pod -n rook-ceph  $(kubectl -n rook-ceph get pod -l app=rook-ceph-mgr -o jsonpath="{.items[0].metadata.name}")

kubectl -n rook-ceph port-forward $(kubectl -n rook-ceph get pod -l app=rook-ceph-mgr -o jsonpath="{.items[0].metadata.name}") 8443:8443

curl -k https://localhost:8443
...

The reason for port-forward not working is due to the fact that the dashboard is only listening on the Pod IP and not localhost (anymore), but port-forward is only “connecting” to localhost. That is causing the error when trying to access the dashboard through port-forward.

@travisn

On Mon, 28 Jan 2019, 21:12 Chey, notifications@github.com wrote:

We should be able to port-forward the service but it’s not working for me either. That being said as a work around the NodePort option does work as described here https://rook.github.io/docs/rook/master/ceph-dashboard.html.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rook/rook/issues/2526#issuecomment-458283357, or mute the thread https://github.com/notifications/unsubscribe-auth/ADi8_rRb6Oct0Ra3UXGkPIfAQTowr9ASks5vH1mngaJpZM4aK820 .

We should be able to port-forward the service but it’s not working for me either. That being said as a work around the NodePort option does work as described here.