Files
my-rook-config/Documentation/ceph-toolbox.md
T

73 lines
2.0 KiB
Markdown
Raw Normal View History

---
title: Toolbox
2019-02-04 09:46:00 -08:00
weight: 11100
2018-01-12 16:55:23 -08:00
indent: true
---
2019-10-24 10:22:08 +02:00
# Rook Toolbox
2017-08-08 14:03:04 -07:00
The Rook toolbox is a container with common tools used for rook debugging and testing.
2018-05-11 16:40:28 -06:00
The toolbox is based on CentOS, so more tools of your choosing can be easily installed with `yum`.
2017-03-15 13:59:06 -07:00
2020-04-20 15:48:59 -06:00
The toolbox can be run in two modes:
1. [Interactive](#interactive-toolbox): Start a toolbox pod where you can connect and execute Ceph commands from a shell
2. [One-time job](#toolbox-job): Run a script with Ceph commands and collect the results from the job log
2017-04-14 17:09:18 -07:00
> Prerequisite: Before running the toolbox you should have a running Rook cluster deployed (see the [Quickstart Guide](quickstart.md)).
2020-04-20 15:48:59 -06:00
## Interactive Toolbox
The rook toolbox can run as a deployment in a Kubernetes cluster where you can connect and
run arbitrary Ceph commands.
2017-08-08 14:03:04 -07:00
Launch the rook-ceph-tools pod:
2019-10-24 10:22:08 +02:00
```console
2021-09-22 10:37:07 +02:00
kubectl create -f deploy/examples/toolbox.yaml
2017-03-15 13:59:06 -07:00
```
Wait for the toolbox pod to download its container and get to the `running` state:
2019-10-24 10:22:08 +02:00
```console
2020-11-08 03:34:16 +01:00
kubectl -n rook-ceph rollout status deploy/rook-ceph-tools
2017-03-15 13:59:06 -07:00
```
Once the rook-ceph-tools pod is running, you can connect to it with:
2019-10-24 10:22:08 +02:00
```console
2020-11-08 03:34:16 +01:00
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash
2017-03-15 13:59:06 -07:00
```
All available tools in the toolbox are ready for your troubleshooting needs.
2019-10-24 10:22:08 +02:00
**Example**:
* `ceph status`
* `ceph osd status`
* `ceph df`
* `rados df`
2017-03-15 13:59:06 -07:00
2018-10-02 16:42:55 -06:00
When you are done with the toolbox, you can remove the deployment:
2019-10-24 10:22:08 +02:00
```console
2020-11-08 03:34:16 +01:00
kubectl -n rook-ceph delete deploy/rook-ceph-tools
2017-03-15 13:59:06 -07:00
```
2018-03-23 14:21:44 -07:00
2020-04-20 15:48:59 -06:00
## Toolbox Job
2019-10-24 10:22:08 +02:00
2020-04-20 15:48:59 -06:00
If you want to run Ceph commands as a one-time operation and collect the results later from the
logs, you can run a script as a Kubernetes Job. The toolbox job will run a script that is embedded
in the job spec. The script has the full flexibility of a bash script.
In this example, the `ceph status` command is executed when the job is created.
Create the toolbox job:
```console
2021-09-22 10:37:07 +02:00
kubectl create -f deploy/examples/toolbox-job.yaml
2020-04-20 15:48:59 -06:00
```
After the job completes, see the results of the script:
```console
kubectl -n rook-ceph logs -l job-name=rook-ceph-toolbox-job
```