Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow noninteractive use of rqlite CLI for readiness checks #1508

Open
jtackaberry opened this issue Dec 20, 2023 · 0 comments
Open

Allow noninteractive use of rqlite CLI for readiness checks #1508

jtackaberry opened this issue Dec 20, 2023 · 0 comments

Comments

@jtackaberry
Copy link
Contributor

jtackaberry commented Dec 20, 2023

Per comment on #1495, in order to support mTLS for HTTP in Kubernetes with appropriate health probing, the ideal option seems to be to call rqlite CLI inside the container to run a readiness check. However this isn't currently possible, because this command never terminates:

echo .ready | rqlite [...]

From Kubernetes' perspective, the cleanest solution would be a noninteractive command that exits with status 0 on success (ready), and non-zero on failure (not ready). And perhaps that would be easy for rqlite as well, just to implement an additional single-purpose command line option?

A more flexible option would be to update rqlite to support arbitrary commands non-interactively. This would be analogous to the sqlite3 CLI's ability to receive SQL statements in the second optional non-flag positional command line argument. The SQL is run, and the process terminates.

While more generally useful for rqlite at large, this is actually slightly less clean for the K8s side, because if I called rqlite [...] .ready , if the command doesn't indicate readiness status via exit code, I would need to also rely on a shell to pipe rqlite's output to grep inside the container, whereas a dedicated readiness check flag in the rqlite CLI (that works as I first described above) would only depend on the presence of rqlite (so compatible with stripped down distroless containers).

But ultimately I can make either work given the current container that includes busybox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant