Skip to content

feat: bootstrap new instances with an init container instead of a separate Job - #11319

Open
leonardoce wants to merge 1 commit into
cloudnative-pg:mainfrom
leonardoce:remove-jobs-initcontainer
Open

feat: bootstrap new instances with an init container instead of a separate Job#11319
leonardoce wants to merge 1 commit into
cloudnative-pg:mainfrom
leonardoce:remove-jobs-initcontainer

Conversation

@leonardoce

@leonardoce leonardoce commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

New primary and replica instances are now bootstrapped (initdb, recovery,
pg_basebackup, join, and snapshot restore) directly on the instance Pod via
an init container, instead of running a separate Kubernetes Job beforehand.
This removes the extra Job resource previously created for every new
instance, along with its own Pod, and the wait for that Job to complete
before the actual instance Pod could start.

Closes: #11228

Important

This is an alternative approach for #11231 that is less invasive on the codebase.
It requires #11315 to be merged too.

@leonardoce
leonardoce marked this pull request as ready for review August 13, 2026 08:04
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.29 release-1.30 labels Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement 🪄 New feature or request labels Aug 13, 2026
@leonardoce leonardoce added do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.29 release-1.30 labels Aug 13, 2026
@leonardoce

Copy link
Copy Markdown
Contributor Author

/test bp=pr-1025 l=kind

@github-actions

Copy link
Copy Markdown
Contributor

@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/31681054762

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2026
…arate Job

New primary and replica instances are now bootstrapped (initdb, recovery,
pg_basebackup, join, and snapshot restore) directly on the instance Pod via
an init container, instead of running a separate Kubernetes Job beforehand.
This removes the extra Job resource previously created for every new
instance, along with its own Pod, and the wait for that Job to complete
before the actual instance Pod could start.

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
@leonardoce
leonardoce force-pushed the remove-jobs-initcontainer branch from cb78fa2 to 4987ac8 Compare August 17, 2026 08:51
@leonardoce

Copy link
Copy Markdown
Contributor Author

/test bp=pr-1025 l=kind

@github-actions

Copy link
Copy Markdown
Contributor

@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/32012769354

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release enhancement 🪄 New feature or request lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Bootstrap PostgreSQL instances without a separate Job or init container

3 participants