Repository navigation
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/37312910383 |
|
/test |
|
@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/38232097227 |
…trap A Pod created with the bootstrap-instance init container has no init container status until the kubelet first reports on it. The PVC classifier looked only at the status, so in that window it took the missing entry for a Pod without the container, classified the PVC as healthy and marked it ready before the bootstrap had run. The Pod spec now decides whether the container is there, and the PVC stays initializing until its status shows it terminated successfully. Signed-off-by: Armando Ruocco <[email protected]>
The operator attaches the bootstrap-instance init container only to a Pod whose PGDATA PVC is not ready, and marks it ready once the container succeeds. Kubernetes only knows that the container belongs to the Pod: when a backup tool restores the Pod together with its PVCs, it runs the container again on volumes that already hold the instance. An initdb rerun moved the restored data directory aside, or deleted it, and started an empty instance in its place; a join rerun did the same before cloning from a primary that may not be there. The operator now creates the Pod with the cnpg.io/bootstrapPending annotation together with the container, and removes it once the container has succeeded there. The container sees the annotation through the downward API every time it starts, and every bootstrap command (init, join, pgbasebackup, restore and restoresnapshot) exits without touching the volumes when it is not set. A Pod restored after its bootstrap succeeded comes back without it, even when the tool drops the Pod annotations. The instance needs no new access, and the variable lives only in the bootstrap container, which the Pod spec compared for rollouts does not include. Closes #11505 Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Log the skipped bootstrap as a warning. Keep the full reason in IsBootstrapCompleted and fix the foreign init container comment. In the restored pods e2e, wait with the rollout timeout and look for moved aside directories with find. Signed-off-by: Marco Nenciarini <[email protected]>
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41097534768 |
The spec deleted the Lease by hand and failed with a 404 when GC had already removed it. The operator deletes an ownerless Lease when it restores a Cluster from orphan PVCs, so the manual step is not needed. Signed-off-by: Marco Nenciarini <[email protected]>
|
/test |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41289984693 |
The
bootstrap-instanceinit container runs on a Pod whose PGDATA PVC is not ready, and Kubernetes runs it again whenever the Pod is recreated as it was, for example when a backup tool restores the Pod with its PVCs or the kubelet recreates the Pod sandbox. On a volume that already holds the instance,initdbmoves the data directory aside and starts an empty instance.The operator now creates the Pod with the
cnpg.io/bootstrapPendingannotation, which the container reads through the downward API, and removes it once the container succeeds. Every bootstrap command logs a warning and exits without touching the volumes when the annotation is not set. This needs no new permission and no API call, and the variable is not part of the Pod spec compared for rollouts.The PVC classifier also took a missing init container status for a Pod without the container, so it marked a PVC ready before the kubelet reported on its Pod, and a Pod replaced then lost its bootstrap container. It now looks at the Pod spec.
Closes #11505