From 2d7814eddacf70d6f59ae59121294ffbe4c05f4a Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Mon, 18 Nov 2024 16:56:37 +0100 Subject: [PATCH] feat: add support for dual stack clusters (#250) Signed-off-by: Ludovic Ortega Co-authored-by: Itay Grudev --- charts/cloudnative-pg/README.md | 2 ++ charts/cloudnative-pg/templates/service.yaml | 6 ++++++ charts/cloudnative-pg/values.schema.json | 6 ++++++ charts/cloudnative-pg/values.yaml | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/charts/cloudnative-pg/README.md b/charts/cloudnative-pg/README.md index a9e569466..f78461cfc 100644 --- a/charts/cloudnative-pg/README.md +++ b/charts/cloudnative-pg/README.md @@ -67,6 +67,8 @@ CloudNativePG Operator Helm Chart | rbac.create | bool | `true` | Specifies whether ClusterRole and ClusterRoleBinding should be created. | | replicaCount | int | `1` | | | resources | object | `{}` | | +| service.ipFamilies | list | `[]` | Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. | +| service.ipFamilyPolicy | string | `""` | Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) | | service.name | string | `"cnpg-webhook-service"` | DO NOT CHANGE THE SERVICE NAME as it is currently used to generate the certificate and can not be configured | | service.port | int | `443` | | | service.type | string | `"ClusterIP"` | | diff --git a/charts/cloudnative-pg/templates/service.yaml b/charts/cloudnative-pg/templates/service.yaml index fc8a4127e..eeed3418d 100644 --- a/charts/cloudnative-pg/templates/service.yaml +++ b/charts/cloudnative-pg/templates/service.yaml @@ -26,6 +26,12 @@ metadata: {{- end }} spec: type: {{ .Values.service.type }} + {{- if .Values.service.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} + {{- end }} + {{- if .Values.service.ipFamilies }} + ipFamilies: {{ .Values.service.ipFamilies | toYaml | nindent 2 }} + {{- end }} ports: - port: {{ .Values.service.port }} targetPort: webhook-server diff --git a/charts/cloudnative-pg/values.schema.json b/charts/cloudnative-pg/values.schema.json index 63fba0454..762bb54d1 100644 --- a/charts/cloudnative-pg/values.schema.json +++ b/charts/cloudnative-pg/values.schema.json @@ -206,6 +206,12 @@ "service": { "type": "object", "properties": { + "ipFamilies": { + "type": "array" + }, + "ipFamilyPolicy": { + "type": "string" + }, "name": { "type": "string" }, diff --git a/charts/cloudnative-pg/values.yaml b/charts/cloudnative-pg/values.yaml index a95165ffd..c39912580 100644 --- a/charts/cloudnative-pg/values.yaml +++ b/charts/cloudnative-pg/values.yaml @@ -126,6 +126,10 @@ service: # and can not be configured name: cnpg-webhook-service port: 443 + # -- Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) + ipFamilyPolicy: "" + # -- Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. + ipFamilies: [] resources: {} # If you want to specify resources, uncomment the following