I'm trying to implement livenessProbes on pods running under K8s. Only very simple probe is working, see example:
livenessProbe:
exec:
command:
- cat
- /etc/services
initialDelaySeconds: 45
timeoutSeconds: 5
Probe I need to implement is killing pod every 50sec.
livenessProbe:
exec:
command:
mongo --port 27018 --eval "rs.status()" | grep "REMOVED" ; test $? -eq 1
initialDelaySeconds: 45
timeoutSeconds: 5
When probe is not implemented and command run inside a pod it is returning 1 if REMOVED string found and 0 if not found as required.
[root@eas-mongo-rs-3-ui81p /]# mongo --port 27018 --eval "rs.status()" | grep "REMOVED" ; test $? -eq 1
Question is, how to implement such command as Container Exec Check.
Regards