Rook Toolbox

The Rook toolbox is a container with common tools used for rook debugging and testing. The toolbox is based on CentOS, so more tools of your choosing can be easily installed with yum.

Running the Toolbox in Kubernetes

The rook toolbox can run as a deployment in a Kubernetes cluster. After you ensure you have a running Kubernetes cluster with rook deployed (see the Kubernetes instructions), launch the rook-ceph-tools pod.

Save the tools spec as toolbox.yaml:

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: rook-ceph-tools
  5. namespace: rook-ceph
  6. labels:
  7. app: rook-ceph-tools
  8. spec:
  9. replicas: 1
  10. selector:
  11. matchLabels:
  12. app: rook-ceph-tools
  13. template:
  14. metadata:
  15. labels:
  16. app: rook-ceph-tools
  17. spec:
  18. dnsPolicy: ClusterFirstWithHostNet
  19. containers:
  20. - name: rook-ceph-tools
  21. image: rook/ceph:v1.3.3
  22. command: ["/tini"]
  23. args: ["-g", "--", "/usr/local/bin/toolbox.sh"]
  24. imagePullPolicy: IfNotPresent
  25. env:
  26. - name: ROOK_ADMIN_SECRET
  27. valueFrom:
  28. secretKeyRef:
  29. name: rook-ceph-mon
  30. key: admin-secret
  31. volumeMounts:
  32. - mountPath: /etc/ceph
  33. name: ceph-config
  34. - name: mon-endpoint-volume
  35. mountPath: /etc/rook
  36. volumes:
  37. - name: mon-endpoint-volume
  38. configMap:
  39. name: rook-ceph-mon-endpoints
  40. items:
  41. - key: data
  42. path: mon-endpoints
  43. - name: ceph-config
  44. emptyDir: {}
  45. tolerations:
  46. - key: "node.kubernetes.io/unreachable"
  47. operator: "Exists"
  48. effect: "NoExecute"
  49. tolerationSeconds: 5

Launch the rook-ceph-tools pod:

  1. kubectl create -f toolbox.yaml

Wait for the toolbox pod to download its container and get to the running state:

  1. kubectl -n rook-ceph get pod -l "app=rook-ceph-tools"

Once the rook-ceph-tools pod is running, you can connect to it with:

  1. kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') bash

All available tools in the toolbox are ready for your troubleshooting needs.

Example:

  • ceph status
  • ceph osd status
  • ceph df
  • rados df

When you are done with the toolbox, you can remove the deployment:

  1. kubectl -n rook-ceph delete deployment rook-ceph-tools

Troubleshooting without the Toolbox

The Ceph tools will commonly be the only tools needed to troubleshoot a cluster. In that case, you can connect to any of the rook pods and execute the ceph commands in the same way that you would in the toolbox pod such as the mon pods or the operator pod. If connecting to the mon pods, make sure you connect to the mon most recently started. The mons keep the config updated in memory after starting and may not have the latest config on disk. For example, after starting the cluster connect to the mon2 pod instead of mon0.