From 111173f009dc2b41c4bdba6f8121c913b57c9b75 Mon Sep 17 00:00:00 2001 From: Abdullah Alaqeel Date: Fri, 4 Sep 2026 00:45:54 +0300 Subject: [PATCH] feat(redis-ha): expose ipFamilies/ipFamilyPolicy on headless and announce services Signed-off-by: Abdullah Alaqeel --- charts/redis-ha/Chart.yaml | 2 +- charts/redis-ha/README.md | 6 ++++++ charts/redis-ha/templates/redis-ha-announce-service.yaml | 6 ++++++ charts/redis-ha/templates/redis-ha-service.yaml | 6 ++++++ charts/redis-ha/values.yaml | 6 ++++++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/charts/redis-ha/Chart.yaml b/charts/redis-ha/Chart.yaml index d4e21a86..5c4e920a 100644 --- a/charts/redis-ha/Chart.yaml +++ b/charts/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 4.39.0 +version: 4.40.0 appVersion: 8.8.0 description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management icon: https://img.icons8.com/external-tal-revivo-shadow-tal-revivo/24/external-redis-an-in-memory-data-structure-project-implementing-a-distributed-logo-shadow-tal-revivo.png diff --git a/charts/redis-ha/README.md b/charts/redis-ha/README.md index 56eaf46b..7aa869ac 100644 --- a/charts/redis-ha/README.md +++ b/charts/redis-ha/README.md @@ -91,6 +91,8 @@ The following table lists the configurable parameters of the Redis chart and the | `image.tag` | Redis image tag | string | `"8.8.0-alpine"` | | `imagePullSecrets` | Reference to one or more secrets to be used when pulling redis images | list | `[]` | | `init.resources` | Extra init resources | object | `{}` | +| `ipFamilies` | ipFamilies for the headless and announce Services (e.g. ["IPv6"]). Empty = cluster default. | list | `[]` | +| `ipFamilyPolicy` | ipFamilyPolicy for the headless and announce Services (e.g. SingleStack / PreferDualStack). Empty = cluster default. | string | `""` | | `labels` | Custom labels for the redis pod | object | `{}` | | `nameOverride` | Name override for Redis HA resources | string | `""` | | `networkPolicy.annotations` | Annotations for NetworkPolicy | object | `{}` | @@ -438,6 +440,10 @@ Risk is limited because announce-service is using `publishNotReadyAddresses: tru PodDisruptionBudgets are not configured by default, you may need to set the `haproxy.podDisruptionBudget` parameter in values.yaml to enable it. +### Dual-stack and IPv6-primary clusters + +On dual-stack or IPv6-primary clusters, setting `sentinel.resolveHostnames: true` and `sentinel.announceHostnames: true` is recommended: HAProxy backend server lines then use the announce Service FQDNs and Sentinel announces hostnames instead of start-time resolved IPs. To run the Services IPv6-primary, additionally set `ipFamilies`/`ipFamilyPolicy` (headless and announce Services) and `haproxy.service.ipFamilies`/`haproxy.service.ipFamilyPolicy`. Changing a Service's family is rejected in place by admission, so conversion requires delete+recreate (letting Helm/Argo CD own the recreate is exactly why these values exist). + ## Network policies If `networkPolicy.enabled` is set to `true`, then a `NetworkPolicy` resource is created with default rules to allow inter-Redis and Sentinel connectivity. diff --git a/charts/redis-ha/templates/redis-ha-announce-service.yaml b/charts/redis-ha/templates/redis-ha-announce-service.yaml index bfc2449d..a9cb74a6 100644 --- a/charts/redis-ha/templates/redis-ha-announce-service.yaml +++ b/charts/redis-ha/templates/redis-ha-announce-service.yaml @@ -26,6 +26,12 @@ spec: publishNotReadyAddresses: true {{- end }} type: ClusterIP + {{- if $root.Values.ipFamilyPolicy }} + ipFamilyPolicy: {{ $root.Values.ipFamilyPolicy }} + {{- end }} + {{- if $root.Values.ipFamilies }} + ipFamilies: {{ toYaml $root.Values.ipFamilies | nindent 2 }} + {{- end }} ports: {{- if ne (int $root.Values.redis.port) 0 }} - name: tcp-server diff --git a/charts/redis-ha/templates/redis-ha-service.yaml b/charts/redis-ha/templates/redis-ha-service.yaml index 5fe077ea..11b1a3d8 100644 --- a/charts/redis-ha/templates/redis-ha-service.yaml +++ b/charts/redis-ha/templates/redis-ha-service.yaml @@ -21,6 +21,12 @@ metadata: spec: type: ClusterIP clusterIP: None + {{- if .Values.ipFamilyPolicy }} + ipFamilyPolicy: {{ .Values.ipFamilyPolicy }} + {{- end }} + {{- if .Values.ipFamilies }} + ipFamilies: {{ toYaml .Values.ipFamilies | nindent 2 }} + {{- end }} ports: {{- if ne (int .Values.redis.port) 0 }} - name: tcp-server diff --git a/charts/redis-ha/values.yaml b/charts/redis-ha/values.yaml index 95ad969f..55d41404 100644 --- a/charts/redis-ha/values.yaml +++ b/charts/redis-ha/values.yaml @@ -58,6 +58,12 @@ labels: {} # -- Custom labels for redis service serviceLabels: {} +# -- ipFamilyPolicy for the headless and announce Services (e.g. SingleStack / PreferDualStack). Empty = cluster default. +ipFamilyPolicy: "" + +# -- ipFamilies for the headless and announce Services (e.g. ["IPv6"]). Empty = cluster default. +ipFamilies: [] + ## Custom labels for the redis configmap configmap: # -- Custom labels for the redis configmap