We have a requirement to have both http and exec in a single readiness probe.
Check 1: Launch a particular URL and check if we get a success response Check 2: Execute a UNIX script/code to check some availability of files
If both the checks are success then the pod can be declared as ready.
We tried below. It seems multiple handles under single readinessProbe is not supported. Is there any other alternative simple way to achieve this?
readinessProbe:
exec:
command:
- /bin/sh
-c
- "unix script to run"
httpGet:
path: /http url
intialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 10
I agree with Mr larsks' comment.
You can create a custom script that performs both http check and internal health checks. Use this script as the
commandin an exec probe.The script should exit with a 0 status code if both checks pass, indicating readiness.
Here's an example: