Repository navigation
feat: support customizable pod patches via annotations - #6323
Merged
Merged
Conversation
armru
marked this pull request as ready for review
December 18, 2024 16:42
armru
force-pushed
the
dev/json-patch-pod
branch
2 times, most recently
from
December 18, 2024 16:50
824e27b to
9d1187c
Compare
leonardoce
force-pushed
the
dev/json-patch-pod
branch
from
January 7, 2025 13:27
9d1187c to
fd683c9
Compare
armru
force-pushed
the
dev/json-patch-pod
branch
from
January 7, 2025 13:48
fd683c9 to
bf524bc
Compare
leonardoce
approved these changes
Jan 7, 2025
leonardoce
requested review from
NiccoloFei,
jsilvela and
litaocdl
as code owners
January 7, 2025 16:04
Contributor
|
Added an E2e test and documented the new annotation. |
Contributor
|
E2e tests are green, this PR is fine to me! |
mnencia
force-pushed
the
dev/json-patch-pod
branch
2 times, most recently
from
January 31, 2025 08:44
8fb1e7a to
868252f
Compare
Member
|
/test d=push tl=4 |
Contributor
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/13069318454 |
mnencia
force-pushed
the
dev/json-patch-pod
branch
from
January 31, 2025 08:46
868252f to
8e8f83d
Compare
mnencia
approved these changes
Jan 31, 2025
mnencia
force-pushed
the
dev/json-patch-pod
branch
from
January 31, 2025 09:56
8e8f83d to
94821fa
Compare
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Gabriele Bartolini <[email protected]>
mnencia
force-pushed
the
dev/json-patch-pod
branch
from
January 31, 2025 10:57
b274a7a to
6d66ede
Compare
usiegj00
added a commit
to usiegj00/cloudnative-pg
that referenced
this pull request
Oct 25, 2025
…list too long errors This change sets enableServiceLinks to false in all bootstrap job pod specs (initdb, join, recovery, etc.) to prevent the 'exec /manager: argument list too long' error that occurs in namespaces with many services. While PR cloudnative-pg#6323 fixed this issue for regular cluster instance pods by introducing the cnpg.io/podPatch annotation, bootstrap jobs are created separately and were not covered by that fix. Since these jobs use the same bootstrap-controller init container that fails when receiving excessive environment variables from Kubernetes service links, they experience the same issue in high-density namespaces. This issue was reported in a production environment with 465 PostgreSQL databases in a single namespace, where the bootstrap controller in job pods would fail to start during cluster initialization or when adding new replicas. Bootstrap jobs do not require service discovery via environment variables as they use DNS or explicit connection strings from secrets, making this a safe default. Fixes cloudnative-pg#6234 Signed-off-by: Jonathan Siegel <[email protected]>
usiegl00
pushed a commit
to usiegl00/cloudnative-pg
that referenced
this pull request
Nov 17, 2025
…list too long errors This change sets enableServiceLinks to false in all bootstrap job pod specs (initdb, join, recovery, etc.) to prevent the 'exec /manager: argument list too long' error that occurs in namespaces with many services. While PR cloudnative-pg#6323 fixed this issue for regular cluster instance pods by introducing the cnpg.io/podPatch annotation, bootstrap jobs are created separately and were not covered by that fix. Since these jobs use the same bootstrap-controller init container that fails when receiving excessive environment variables from Kubernetes service links, they experience the same issue in high-density namespaces. This issue was reported in a production environment with 465 PostgreSQL databases in a single namespace, where the bootstrap controller in job pods would fail to start during cluster initialization or when adding new replicas. Bootstrap jobs do not require service discovery via environment variables as they use DNS or explicit connection strings from secrets, making this a safe default. Fixes cloudnative-pg#6234 Signed-off-by: Jonathan Siegel <[email protected]>
mnencia
pushed a commit
to usiegj00/cloudnative-pg
that referenced
this pull request
Jul 15, 2026
…list too long errors This change sets enableServiceLinks to false in all bootstrap job pod specs (initdb, join, recovery, etc.) to prevent the 'exec /manager: argument list too long' error that occurs in namespaces with many services. While PR cloudnative-pg#6323 fixed this issue for regular cluster instance pods by introducing the cnpg.io/podPatch annotation, bootstrap jobs are created separately and were not covered by that fix. Since these jobs use the same bootstrap-controller init container that fails when receiving excessive environment variables from Kubernetes service links, they experience the same issue in high-density namespaces. This issue was reported in a production environment with 465 PostgreSQL databases in a single namespace, where the bootstrap controller in job pods would fail to start during cluster initialization or when adding new replicas. Bootstrap jobs do not require service discovery via environment variables as they use DNS or explicit connection strings from secrets, making this a safe default. Fixes cloudnative-pg#6234 Signed-off-by: Jonathan Siegel <[email protected]>
usiegj00
added a commit
to usiegj00/cloudnative-pg
that referenced
this pull request
Jul 16, 2026
Extend the enableServiceLinks=false default from bootstrap jobs to the PostgreSQL instance pods. Setting EnableServiceLinks to false on the instance PodSpec built by createClusterPodSpec prevents the "exec /manager: argument list too long" error in namespaces with many services, without relying on the cnpg.io/podPatch annotation workaround from cloudnative-pg#6323. Also aligns the service-links field formatting in the bootstrap job spec. Signed-off-by: Jonathan Siegel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch enables precise customization of pod specifications through the
cnpg.io/podPatchannotation on clusters. By applying valid JSON patches, users can fine-tune pod configurations, including areas not directly configurable within the Cluster resource, offering greater flexibility for advanced use cases.Closes #6234
Release notes
Added support for custom pod patches using the
cnpg.io/podPatchannotation, enabling user-defined pod adjustments.