Done
Details
Assignee
Andreas GeißlerAndreas GeißlerReporter
Andreas GeißlerAndreas GeißlerLabels
Fix versions
Affects versions
Priority
Medium
Details
Details
Assignee
Andreas Geißler
Andreas GeißlerReporter
Andreas Geißler
Andreas GeißlerLabels
Fix versions
Affects versions
Priority
Created March 11, 2024 at 3:54 PM
Updated June 17, 2024 at 8:50 PM
Resolved June 6, 2024 at 2:55 PM
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:
use the "pod" option and select the STS pod name (e.g. so-db-0)
enhance the ReadinessCheck to check for the status of a service
see:
https://github.com/kubernetes-client/python/issues/2133
https://stackoverflow.com/questions/51058401/get-service-selectors-with-k8s-python-client/51073360#51073360