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 pod 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: v1
  2. kind: Pod
  3. metadata:
  4. name: rook-ceph-tools
  5. namespace: rook-ceph
  6. spec:
  7. dnsPolicy: ClusterFirstWithHostNet
  8. containers:
  9. - name: rook-ceph-tools
  10. image: rook/ceph-toolbox:v0.8.3
  11. imagePullPolicy: IfNotPresent
  12. env:
  13. - name: ROOK_ADMIN_SECRET
  14. valueFrom:
  15. secretKeyRef:
  16. name: rook-ceph-mon
  17. key: admin-secret
  18. securityContext:
  19. privileged: true
  20. volumeMounts:
  21. - mountPath: /dev
  22. name: dev
  23. - mountPath: /sys/bus
  24. name: sysbus
  25. - mountPath: /lib/modules
  26. name: libmodules
  27. - name: mon-endpoint-volume
  28. mountPath: /etc/rook
  29. hostNetwork: false
  30. volumes:
  31. - name: dev
  32. hostPath:
  33. path: /dev
  34. - name: sysbus
  35. hostPath:
  36. path: /sys/bus
  37. - name: libmodules
  38. hostPath:
  39. path: /lib/modules
  40. - name: mon-endpoint-volume
  41. configMap:
  42. name: rook-ceph-mon-endpoints
  43. items:
  44. - key: data
  45. path: mon-endpoints

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 rook-ceph-tools

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

  1. kubectl -n rook-ceph exec -it rook-ceph-tools bash

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

  1. ceph status
  2. ceph osd status
  3. ceph df
  4. rados df

When you are done with the toolbox, remove the pod:

  1. kubectl -n rook-ceph delete pod 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.