feat(services): add cluster-wide service template for default services#10425
Open
cagataygurturk wants to merge 1 commit intocloudnative-pg:mainfrom
Open
feat(services): add cluster-wide service template for default services#10425cagataygurturk wants to merge 1 commit intocloudnative-pg:mainfrom
cagataygurturk wants to merge 1 commit intocloudnative-pg:mainfrom
Conversation
77ca4d4 to
ab659bd
Compare
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
ab659bd to
e9ad5b1
Compare
Add a `spec.managed.services.serviceTemplate` field that is applied to all services created by the operator, both the default services (rw, ro, r, any) and additional managed services. For additional services, their own template is merged on top of this base template. The template acts as a defaults layer: service-specific values always take precedence, and the template only fills in fields not already set. This enables first-class IPv6 and dual-stack support without requiring users to disable and recreate default services as managed services, and provides a general-purpose mechanism for configuring any ServiceSpec field across all cluster services. Refs: cloudnative-pg#10424 Signed-off-by: Cagatay Gurturk <963018+cagataygurturk@users.noreply.github.com>
e9ad5b1 to
b7527b2
Compare
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.
Motivation
Currently, the default services (rw, ro, r, any) are created without
ipFamilyPolicyoripFamilies, inheriting the Kubernetes cluster default (typically SingleStack IPv4). The only workaround is to disable default ro/r services and recreate them as managed services with explicit IP family config — but the rw service cannot be disabled, making full IPv6/dual-stack impossible without manual intervention.Changes
Adds a
spec.managed.services.serviceTemplatefield that acts as a defaults layer for all services created by the operator -- both the 4 default services (rw, ro, r, any) and additional managed services. Per-service values always take precedence; the template only fills in unset fields.Example:
While IPv6/dual-stack is the primary driver, the field is general-purpose and can configure any
ServiceSpecfield (e.g.,externalTrafficPolicy,internalTrafficPolicy,loadBalancerClass) across all cluster services.Tested manually on a live dual-stack cluster — all default services received IPv6 ClusterIPs.
Closes #10424
Relates to #7116