Note: solution can use netcat or any other built-in Linux utility
I need to implement an initContainer and liveness probe that confirms my redis pod is up for one of my redis dependent pods. I have attempted the netcat solution offered as the answer here ((printf "PINGrn"; sleep 1) | nc 10.233.38.133 6379
) but I get -NOAUTH Authentication required.
error in response. Any way around this? I am aware I could install redis-cli or make a management command in my Django code but would prefer not to. Nor do I want to implement a web server for my Redis instance and use curl command.
2
Answers
You could always send in your
AUTH
command as part of your probe, like:Unless you’re getting
INFO
from the server, you don’t seem to care about the nature of the response, so no auth is required, just test forNOAUTH
.Here’s the initContainers stanza that you can use:
Just don’t forget to change
<redis-host>
and<password>
to their values.