ceph / ceph/ceph-nagios-plugins
Passing keyring to a cephadm volume for health check
- Dominant language
- Python
- Stars
- 81
- Forks
- 84
- PR merge metrics
- No merged PRs in 30d
Description
Trying to use the `check_ceph_health` script I hit an issue: the keyring is not passed to the `cephadm` container that runs the `ceph` command.
I do not know how this current implementation is supposed to be run but usually there would be an additional switch passed to `cephadm` that mounts the keyring from the host OS to the container as a volume, for example with:
```
cephadm shell -v /etc/ceph/client.nagios.keyring:/etc/ceph/client.nagios.keyring:z
```
Possibly the `:z` at the end of the volume specification would not work on a system without SELinux but I do not have any other than RPM systems to test with. In the example code this is not included since I couldn't test it on other systems.
The example I made is very simple, possibly it is not pretty but Python is not one of my favorites: https://github.com/bluikko/ceph-nagios-plugins/compare/master...bluikko-cephadm-volume
It works on my system but since this was not included in the original implementation it makes me question how was the cephadm support supposed to work earlier. Usually (?) the container it runs would not include keyrings, to my knowledge.
I would like feedback on this before I make a PR.
Additionally running the script without adding the above patch fails at line 189 on Python 3.9 (the real error is about the missing keyring)...
```
TypeError: a bytes-like object is required, not 'str'
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.