2022-08-23 16:49:53 +05:30
---
2023-09-27 16:54:42 +05:30
title : kubectl Plugin
2022-08-23 16:49:53 +05:30
---
2023-09-27 16:54:42 +05:30
The Rook kubectl plugin is a tool to help troubleshoot your Rook cluster. Here are a few of the operations that the plugin will assist with:
2022-08-23 20:12:37 +05:30
- Health of the Rook pods
- Health of the Ceph cluster
- Create "debug" pods for mons and OSDs that are in need of special Ceph maintenance operations
- Restart the operator
- Purge an OSD
- Run any `ceph` command
See the [kubectl-rook-ceph documentation ](https://github.com/rook/kubectl-rook-ceph ) for more details.
2022-08-23 16:49:53 +05:30
## Installation
2023-09-27 16:54:42 +05:30
- Install [krew ](https://krew.sigs.k8s.io/docs/user-guide/setup/install/ )
- Install Rook plugin
2024-04-22 11:54:27 -06:00
```console
2023-10-19 13:44:34 +08:00
kubectl krew install rook-ceph
2024-04-22 11:54:27 -06:00
` ``
2022-08-23 16:49:53 +05:30
2022-08-23 20:12:37 +05:30
## Ceph Commands
2022-08-23 16:49:53 +05:30
2023-09-27 16:54:42 +05:30
- Run any ` ceph` command with ` kubectl rook-ceph ceph <args>`. For example, get the Ceph status:
2024-04-22 11:54:27 -06:00
` ``console
2022-08-23 16:49:53 +05:30
kubectl rook-ceph ceph status
2024-04-22 11:54:27 -06:00
` ``
2022-08-23 16:49:53 +05:30
2024-04-22 11:54:27 -06:00
Output:
2023-09-27 16:54:42 +05:30
2024-04-22 11:54:27 -06:00
` ``console
cluster:
id: a1ac6554-4cc8-4c3b-a8a3-f17f5ec6f529
health: HEALTH_OK
2022-08-23 16:49:53 +05:30
2024-04-22 11:54:27 -06:00
services:
mon: 3 daemons, quorum a,b,c (age 11m)
mgr: a(active, since 10m)
mds: 1/1 daemons up, 1 hot standby
osd: 3 osds: 3 up (since 10m), 3 in (since 8d)
2022-08-23 16:49:53 +05:30
2024-04-22 11:54:27 -06:00
data:
volumes: 1/1 healthy
pools: 6 pools, 137 pgs
objects: 34 objects, 4.1 KiB
usage: 58 MiB used, 59 GiB / 59 GiB avail
pgs: 137 active+clean
2022-08-23 16:49:53 +05:30
2024-04-22 11:54:27 -06:00
io:
client: 1.2 KiB/s rd, 2 op/s rd, 0 op/s wr
` ``
2022-08-23 16:49:53 +05:30
2022-08-23 20:12:37 +05:30
Reference: [Ceph Status](https://github.com/rook/kubectl-rook-ceph/blob/master/README.md#run-a-ceph-command)
## Debug Mode
Debug mode can be useful when a MON or OSD needs advanced maintenance operations that require the daemon to be stopped. Ceph tools such as ` ceph-objectstore-tool`, ` ceph-bluestore-tool`, or ` ceph-monstore-tool` are commonly used in these scenarios. Debug mode will set up the MON or OSD so that these commands can be run.
2023-09-27 16:54:42 +05:30
- Start the debug pod for mon b
2024-04-22 11:54:27 -06:00
` ``console
2022-08-23 20:12:37 +05:30
kubectl rook-ceph debug start rook-ceph-mon-b
2024-04-22 11:54:27 -06:00
` ``
2022-08-23 20:12:37 +05:30
2023-09-27 16:54:42 +05:30
- Stop the debug pod for mon b
2024-04-22 11:54:27 -06:00
` ``console
2022-08-23 20:12:37 +05:30
kubectl rook-ceph debug stop rook-ceph-mon-b
2024-04-22 11:54:27 -06:00
` ``
2022-08-23 20:12:37 +05:30
Reference: [Debug Mode ](https://github.com/rook/kubectl-rook-ceph/blob/master/README.md#debug-mode )