Files
my-rook-config/Documentation/Troubleshooting/kubectl-plugin.md
T
Blaine Gardner c9d99e01a0 ci: use markdownlint to enforce mkdocs compatibility
mkdocs uses a markdown renderer that is hardcoded to 4 spaces per tab
for detecting indentation levels, including ordered- and
unordered-lists. Since we cannot easily change the renderer, begin using
a markdown linter in CI that will fail if official docs do not adhere to
the spacing rules.

As a starting point, the markdownlint config does not begin with the
default set of checks, which might overwhelm attempts to fix them.
Instead, focus on list-tab-spacing rules and a few other highly useful
checks.

markdownlint also has some gaps in its abilities that allow common Rook
doc issues to pass acceptance. However, it allows creating custom
linting plugins. Create 2 such linting plugins to check 2 things:

- all doc lines (except code blocks) must be aligned to a 4-space
  boundary, without exception. This ensures that markdown will render
  correctly with mkdocs. This unfortunately makes it possible to create
  lists that are internally aligned strangely.
- admonitions must all follow the same format of
  ```
  !!! header
      body
  ```

For the strange lists, this is allowed and renders correctly, but it
looks strange:

```md
- first bullet
- second bullet
    still second bullet
- third bullet

    has a paragraph
    of text inside

- last bullet

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-04-29 17:25:11 -06:00

2.1 KiB

title
title
kubectl Plugin

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:

  • 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 for more details.

Installation

  • Install krew

  • Install Rook plugin

    kubectl krew install rook-ceph
    

Ceph Commands

  • Run any ceph command with kubectl rook-ceph ceph <args>. For example, get the Ceph status:

    kubectl rook-ceph ceph status
    

    Output:

        cluster:
        id:     a1ac6554-4cc8-4c3b-a8a3-f17f5ec6f529
        health: HEALTH_OK
    
        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)
    
        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
    
        io:
        client:   1.2 KiB/s rd, 2 op/s rd, 0 op/s wr
    

Reference: Ceph Status

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.

  • Start the debug pod for mon b

    kubectl rook-ceph debug start rook-ceph-mon-b
    
  • Stop the debug pod for mon b

    kubectl rook-ceph debug stop rook-ceph-mon-b
    

Reference: Debug Mode