Challenge, Medium,  on  Kubernetes

File-Aware Readiness Probe for Container Initialization

Scenerio

Create a single Pod named python-app-pod in namespace python-app of image busybox:stable. The Pod should have a readiness probe executing:

cat /src/main.py

It should initially wait 15 seconds, periodically wait 15 seconds, and have failureThreshold set to 2.

This will set the container ready only if the file /src/main.py exists.


Hint

Use a container command that creates /src/main.py and keeps the container running (sleep), and an exec readinessProbe (cat /src/main.py) so the Pod becomes Ready only when the file exists.


Test Cases