Complete the code to define a liveness probe in a Kubernetes pod spec.
livenessProbe:
httpGet:
path: [1]
port: 8080The liveness probe commonly uses the /healthz endpoint to check if the container is alive.
Complete the code to define a readiness probe command in a Kubernetes pod.
readinessProbe:
exec:
command: ["[1]", "-c", "curl -f http://localhost:8080/ready || exit 1"]The readiness probe often uses a shell command like sh to run a curl command inside the container.
Fix the error in the Kubernetes readiness probe configuration.
readinessProbe:
tcpSocket:
port: [1]The tcpSocket probe requires a port number, not a string or protocol name.
Fill both blanks to create a Kubernetes liveness probe that checks an HTTP endpoint after a 10 second initial delay.
livenessProbe:
httpGet:
path: [1]
port: 8080
initialDelaySeconds: [2]The liveness probe should check the /healthz path and start after 10 seconds delay.
Fill in the blank to define a readiness probe with an exec command that retries curl 3 times.
readinessProbe:
exec:
command: ["[1]", "-c", "for i in {1..3}; do curl -f http://localhost:8080/ready && exit 0 || sleep 1; done; exit 1"]The bash shell supports the for loop syntax used in the command.