Readiness Jobs in DB-Init jobs should make sure, that the DB is up and running, before the job is started.
Current ReadinessCheck offers the check options:
- containers (check the container name inside pod)
- pods (check the pod name)
- apps (check pods with the given "app" label)
Usually this works well.
But in case e.g. mariadb-operator created DBs it fails, as the operator starts a job prior to the STS with the actual DB. But job and STS pod use the same "app" label.
As the DB job ReadinessProbe use the "app" label option, the job gets started too fast and kills the DB initialisation.
There are 2 options: