Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/1380.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make the IP family of every Service the operator creates for pulp-api, pulp-content, the database, and otel (SingleStack/PreferDualStack/RequireDualStack, IPv4/IPv6/dual-stack) configurable via two new Pulp CR fields, `ip_family_policy` and `ip_families`, mirroring `corev1.ServiceSpec`'s own fields exactly. Defaults (unset) are unchanged from today's hardcoded SingleStack/IPv4 behavior.
29 changes: 29 additions & 0 deletions apis/repo-manager.pulpproject.org/v1/pulp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,35 @@ type PulpSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:io.kubernetes:Secret","urn:alm:descriptor:com.tectonic.ui:advanced"}
SigningScripts string `json:"signing_scripts,omitempty"`

// The IP family policy to use for the Services the operator creates for
// pulp-api, pulp-content, the database, and otel. Does not apply to
// pulp-web or redis, which inherit the cluster's default IP family.
// Mirrors corev1.ServiceSpec.IPFamilyPolicy exactly: SingleStack,
// PreferDualStack, or RequireDualStack.
// Default: SingleStack
// Kubernetes only allows changing this on an existing Service from
// SingleStack to a dual-stack policy; other transitions are rejected
// by the API server as immutable, so set it before first creating a Pulp CR.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Enum:=SingleStack;PreferDualStack;RequireDualStack
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced"}
IPFamilyPolicy *corev1.IPFamilyPolicy `json:"ip_family_policy,omitempty"`

// The IP families to assign to the Services the operator creates for
// pulp-api, pulp-content, the database, and otel. Does not apply to
// pulp-web or redis, which inherit the cluster's default IP family.
// Mirrors corev1.ServiceSpec.IPFamilies exactly: a list of "IPv4" and/or
// "IPv6", order determines primary family under PreferDualStack/RequireDualStack.
// Must match what the cluster's CNI/cluster-cidr actually supports; the
// operator does not validate this and passes it straight through.
// Default: ["IPv4"]
// See ip_family_policy for the same create-time-only caveat.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MaxItems:=2
// +listType:=set
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:advanced"}
IPFamilies []corev1.IPFamily `json:"ip_families,omitempty"`

// The ingress type to use to reach the deployed instance.
// Default: none (will not expose the service)
// +kubebuilder:validation:Optional
Expand Down
10 changes: 10 additions & 0 deletions apis/repo-manager.pulpproject.org/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion bundle/manifests/pulp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ metadata:
capabilities: Full Lifecycle
categories: Integration & Delivery
containerImage: quay.io/pulp/pulp-operator:v1.0.0
createdAt: "2026-03-17T12:18:57Z"
createdAt: "2026-11-05T15:58:44Z"
description: Pulp is a platform for managing repositories of software packages
and making them available to a large number of consumers.
operators.operatorframework.io/builder: operator-sdk-v1.31.0
Expand Down Expand Up @@ -754,6 +754,29 @@ spec:
path: inhibit_version_constraint
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: 'The IP families to assign to the Services the operator creates
for pulp-api, pulp-content, the database, and otel. Does not apply to pulp-web
or redis, which inherit the cluster''s default IP family. Mirrors corev1.ServiceSpec.IPFamilies
exactly: a list of "IPv4" and/or "IPv6", order determines primary family
under PreferDualStack/RequireDualStack. Must match what the cluster''s CNI/cluster-cidr
actually supports; the operator does not validate this and passes it straight
through. Default: ["IPv4"] See ip_family_policy for the same create-time-only
caveat.'
displayName: IPFamilies
path: ip_families
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: 'The IP family policy to use for the Services the operator creates
for pulp-api, pulp-content, the database, and otel. Does not apply to pulp-web
or redis, which inherit the cluster''s default IP family. Mirrors corev1.ServiceSpec.IPFamilyPolicy
exactly: SingleStack, PreferDualStack, or RequireDualStack. Default: SingleStack
Kubernetes only allows changing this on an existing Service from SingleStack
to a dual-stack policy; other transitions are rejected by the API server
as immutable, so set it before first creating a Pulp CR.'
displayName: IPFamily Policy
path: ip_family_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Disable ipv6 for pulpcore and pulp-web pods
displayName: IPv6 Disabled
path: ipv6_disabled
Expand Down
35 changes: 35 additions & 0 deletions bundle/manifests/repo-manager.pulpproject.org_pulps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7475,6 +7475,41 @@ spec:
Relax the check of image_version and image_web_version not matching.
Default: "false"
type: boolean
ip_families:
description: |-
The IP families to assign to the Services the operator creates for
pulp-api, pulp-content, the database, and otel. Does not apply to
pulp-web or redis, which inherit the cluster's default IP family.
Mirrors corev1.ServiceSpec.IPFamilies exactly: a list of "IPv4" and/or
"IPv6", order determines primary family under PreferDualStack/RequireDualStack.
Must match what the cluster's CNI/cluster-cidr actually supports; the
operator does not validate this and passes it straight through.
Default: ["IPv4"]
See ip_family_policy for the same create-time-only caveat.
items:
description: |-
IPFamily represents the IP Family (IPv4 or IPv6). This type is used
to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies).
type: string
maxItems: 2
type: array
x-kubernetes-list-type: set
ip_family_policy:
description: |-
The IP family policy to use for the Services the operator creates for
pulp-api, pulp-content, the database, and otel. Does not apply to
pulp-web or redis, which inherit the cluster's default IP family.
Mirrors corev1.ServiceSpec.IPFamilyPolicy exactly: SingleStack,
PreferDualStack, or RequireDualStack.
Default: SingleStack
Kubernetes only allows changing this on an existing Service from
SingleStack to a dual-stack policy; other transitions are rejected
by the API server as immutable, so set it before first creating a Pulp CR.
enum:
- SingleStack
- PreferDualStack
- RequireDualStack
type: string
ipv6_disabled:
description: Disable ipv6 for pulpcore and pulp-web pods
type: boolean
Expand Down
35 changes: 35 additions & 0 deletions config/crd/bases/repo-manager.pulpproject.org_pulps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7475,6 +7475,41 @@ spec:
Relax the check of image_version and image_web_version not matching.
Default: "false"
type: boolean
ip_families:
description: |-
The IP families to assign to the Services the operator creates for
pulp-api, pulp-content, the database, and otel. Does not apply to
pulp-web or redis, which inherit the cluster's default IP family.
Mirrors corev1.ServiceSpec.IPFamilies exactly: a list of "IPv4" and/or
"IPv6", order determines primary family under PreferDualStack/RequireDualStack.
Must match what the cluster's CNI/cluster-cidr actually supports; the
operator does not validate this and passes it straight through.
Default: ["IPv4"]
See ip_family_policy for the same create-time-only caveat.
items:
description: |-
IPFamily represents the IP Family (IPv4 or IPv6). This type is used
to express the family of an IP expressed by a type (e.g. service.spec.ipFamilies).
type: string
maxItems: 2
type: array
x-kubernetes-list-type: set
ip_family_policy:
description: |-
The IP family policy to use for the Services the operator creates for
pulp-api, pulp-content, the database, and otel. Does not apply to
pulp-web or redis, which inherit the cluster's default IP family.
Mirrors corev1.ServiceSpec.IPFamilyPolicy exactly: SingleStack,
PreferDualStack, or RequireDualStack.
Default: SingleStack
Kubernetes only allows changing this on an existing Service from
SingleStack to a dual-stack policy; other transitions are rejected
by the API server as immutable, so set it before first creating a Pulp CR.
enum:
- SingleStack
- PreferDualStack
- RequireDualStack
type: string
ipv6_disabled:
description: Disable ipv6 for pulpcore and pulp-web pods
type: boolean
Expand Down
23 changes: 23 additions & 0 deletions config/manifests/bases/pulp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,29 @@ spec:
path: inhibit_version_constraint
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: 'The IP families to assign to the Services the operator creates
for pulp-api, pulp-content, the database, and otel. Does not apply to pulp-web
or redis, which inherit the cluster''s default IP family. Mirrors corev1.ServiceSpec.IPFamilies
exactly: a list of "IPv4" and/or "IPv6", order determines primary family
under PreferDualStack/RequireDualStack. Must match what the cluster''s CNI/cluster-cidr
actually supports; the operator does not validate this and passes it straight
through. Default: ["IPv4"] See ip_family_policy for the same create-time-only
caveat.'
displayName: IPFamilies
path: ip_families
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: 'The IP family policy to use for the Services the operator creates
for pulp-api, pulp-content, the database, and otel. Does not apply to pulp-web
or redis, which inherit the cluster''s default IP family. Mirrors corev1.ServiceSpec.IPFamilyPolicy
exactly: SingleStack, PreferDualStack, or RequireDualStack. Default: SingleStack
Kubernetes only allows changing this on an existing Service from SingleStack
to a dual-stack policy; other transitions are rejected by the API server
as immutable, so set it before first creating a Pulp CR.'
displayName: IPFamily Policy
path: ip_family_policy
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- description: Disable ipv6 for pulpcore and pulp-web pods
displayName: IPv6 Disabled
path: ipv6_disabled
Expand Down
2 changes: 2 additions & 0 deletions controllers/repo_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ PulpSpec defines the desired state of Pulp
| db_fields_encryption_secret | Secret where the Fernet symmetric encryption key is stored. Default: <operators's name>-\"-db-fields-encryption\" | string | false |
| signing_secret | Name of the Secret where the gpg key is stored. | string | false |
| signing_scripts | Name of the Secret where the signing scripts are stored. | string | false |
| ip_family_policy | The IP family policy to use for the Services the operator creates for pulp-api, pulp-content, the database, and otel. Does not apply to pulp-web or redis, which inherit the cluster's default IP family. Mirrors corev1.ServiceSpec.IPFamilyPolicy exactly: SingleStack, PreferDualStack, or RequireDualStack. Default: SingleStack Kubernetes only allows changing this on an existing Service from SingleStack to a dual-stack policy; other transitions are rejected by the API server as immutable, so set it before first creating a Pulp CR. | *corev1.IPFamilyPolicy | false |
| ip_families | The IP families to assign to the Services the operator creates for pulp-api, pulp-content, the database, and otel. Does not apply to pulp-web or redis, which inherit the cluster's default IP family. Mirrors corev1.ServiceSpec.IPFamilies exactly: a list of \"IPv4\" and/or \"IPv6\", order determines primary family under PreferDualStack/RequireDualStack. Must match what the cluster's CNI/cluster-cidr actually supports; the operator does not validate this and passes it straight through. Default: [\"IPv4\"] See ip_family_policy for the same create-time-only caveat. | []corev1.IPFamily | false |
| ingress_type | The ingress type to use to reach the deployed instance. Default: none (will not expose the service) | string | false |
| ingress_annotations | Annotations for the Ingress | map[string]string | false |
| ingress_class_name | IngressClassName is used to inform the operator which ingressclass should be used to provision the ingress. Default: \"\" (will use the default ingress class) | string | false |
Expand Down
5 changes: 2 additions & 3 deletions controllers/repo_manager/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,15 @@ func serviceAPIObject(pulp pulpv1.Pulp) *corev1.Service {
func serviceAPISpec(pulp pulpv1.Pulp) corev1.ServiceSpec {

serviceInternalTrafficPolicyCluster := corev1.ServiceInternalTrafficPolicyType("Cluster")
ipFamilyPolicyType := corev1.IPFamilyPolicyType("SingleStack")
serviceAffinity := corev1.ServiceAffinity("None")
servicePortProto := corev1.Protocol("TCP")
targetPort := intstr.IntOrString{IntVal: 24817}
serviceType := corev1.ServiceType("ClusterIP")

return corev1.ServiceSpec{
InternalTrafficPolicy: &serviceInternalTrafficPolicyCluster,
IPFamilies: []corev1.IPFamily{"IPv4"},
IPFamilyPolicy: &ipFamilyPolicyType,
IPFamilies: settings.IPFamilies(pulp),
IPFamilyPolicy: settings.IPFamilyPolicy(pulp),
Ports: []corev1.ServicePort{{
Name: "api-24817",
Port: 24817,
Expand Down
5 changes: 2 additions & 3 deletions controllers/repo_manager/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,15 @@ func serviceContentObject(pulp pulpv1.Pulp) *corev1.Service {
func serviceContentSpec(pulp pulpv1.Pulp) corev1.ServiceSpec {

serviceInternalTrafficPolicyCluster := corev1.ServiceInternalTrafficPolicyType("Cluster")
ipFamilyPolicyType := corev1.IPFamilyPolicyType("SingleStack")
serviceAffinity := corev1.ServiceAffinity("None")
servicePortProto := corev1.Protocol("TCP")
targetPort := intstr.IntOrString{IntVal: 24816}
serviceType := corev1.ServiceType("ClusterIP")

return corev1.ServiceSpec{
InternalTrafficPolicy: &serviceInternalTrafficPolicyCluster,
IPFamilies: []corev1.IPFamily{"IPv4"},
IPFamilyPolicy: &ipFamilyPolicyType,
IPFamilies: settings.IPFamilies(pulp),
IPFamilyPolicy: settings.IPFamilyPolicy(pulp),
Ports: []corev1.ServicePort{{
Name: "content-24816",
Port: 24816,
Expand Down
5 changes: 2 additions & 3 deletions controllers/repo_manager/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ func labelsForDatabasePods(m *pulpv1.Pulp) map[string]string {
// serviceForDatabase returns a service object for postgres pods
func serviceForDatabase(m *pulpv1.Pulp) *corev1.Service {
serviceInternalTrafficPolicyCluster := corev1.ServiceInternalTrafficPolicyType("Cluster")
ipFamilyPolicyType := corev1.IPFamilyPolicyType("SingleStack")
serviceAffinity := corev1.ServiceAffinity("None")
servicePortProto := corev1.Protocol("TCP")
targetPort := intstr.IntOrString{IntVal: 5432}
Expand All @@ -492,8 +491,8 @@ func serviceForDatabase(m *pulpv1.Pulp) *corev1.Service {
ClusterIP: "None",
ClusterIPs: []string{"None"},
InternalTrafficPolicy: &serviceInternalTrafficPolicyCluster,
IPFamilies: []corev1.IPFamily{"IPv4"},
IPFamilyPolicy: &ipFamilyPolicyType,
IPFamilies: settings.IPFamilies(*m),
IPFamilyPolicy: settings.IPFamilyPolicy(*m),
Ports: []corev1.ServicePort{{
Port: 5432,
Protocol: servicePortProto,
Expand Down
Loading
Loading