Skip to content

feat(services): add cluster-wide service template for default services#10425

Open
cagataygurturk wants to merge 1 commit intocloudnative-pg:mainfrom
cagataygurturk:feat/ipv6-dual-stack-default-services
Open

feat(services): add cluster-wide service template for default services#10425
cagataygurturk wants to merge 1 commit intocloudnative-pg:mainfrom
cagataygurturk:feat/ipv6-dual-stack-default-services

Conversation

@cagataygurturk
Copy link
Copy Markdown

@cagataygurturk cagataygurturk commented Apr 8, 2026

Motivation

Currently, the default services (rw, ro, r, any) are created without ipFamilyPolicy or ipFamilies, 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.serviceTemplate field 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:

spec:
  managed:
    services:
      serviceTemplate:
        spec:
          ipFamilyPolicy: SingleStack
          ipFamilies:
            - IPv6

While IPv6/dual-stack is the primary driver, the field is general-purpose and can configure any ServiceSpec field (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

@cagataygurturk cagataygurturk force-pushed the feat/ipv6-dual-stack-default-services branch from 77ca4d4 to ab659bd Compare April 8, 2026 20:12
@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.28 release-1.29 labels Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

❗ 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

@cagataygurturk cagataygurturk force-pushed the feat/ipv6-dual-stack-default-services branch from ab659bd to e9ad5b1 Compare April 8, 2026 20:59
@cagataygurturk cagataygurturk marked this pull request as ready for review April 9, 2026 09:29
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement 🪄 New feature or request labels Apr 9, 2026
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>
@cagataygurturk cagataygurturk force-pushed the feat/ipv6-dual-stack-default-services branch from e9ad5b1 to b7527b2 Compare April 9, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases enhancement 🪄 New feature or request release-1.25 release-1.28 release-1.29 size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support IPv6 dual-stack configuration for default cluster services

2 participants