From 290b9c42890c3b830e06f8ce407b8fb0b529e5fe Mon Sep 17 00:00:00 2001 From: Ludovic Ortega Date: Fri, 19 Apr 2024 17:16:34 +0200 Subject: [PATCH] feat: add support for dual stack clusters Signed-off-by: Ludovic Ortega --- charts/kube-state-metrics/Chart.yaml | 2 +- charts/kube-state-metrics/templates/service.yaml | 4 ++++ charts/kube-state-metrics/values.yaml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/kube-state-metrics/Chart.yaml b/charts/kube-state-metrics/Chart.yaml index 9c5a266e0d47..4e2f08701a09 100644 --- a/charts/kube-state-metrics/Chart.yaml +++ b/charts/kube-state-metrics/Chart.yaml @@ -7,7 +7,7 @@ keywords: - prometheus - kubernetes type: application -version: 5.18.1 +version: 5.19.0 appVersion: 2.12.0 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/charts/kube-state-metrics/templates/service.yaml b/charts/kube-state-metrics/templates/service.yaml index 6c486a662ab0..90c235148f2f 100644 --- a/charts/kube-state-metrics/templates/service.yaml +++ b/charts/kube-state-metrics/templates/service.yaml @@ -14,6 +14,10 @@ metadata: {{- end }} spec: type: "{{ .Values.service.type }}" + {{- if .Values.service.ipDualStack.enabled }} + ipFamilies: {{ toYaml .Values.service.ipDualStack.ipFamilies | nindent 4 }} + ipFamilyPolicy: {{ .Values.service.ipDualStack.ipFamilyPolicy }} + {{- end }} ports: - name: "http" protocol: TCP diff --git a/charts/kube-state-metrics/values.yaml b/charts/kube-state-metrics/values.yaml index 443f309a279d..2e8283a89469 100644 --- a/charts/kube-state-metrics/values.yaml +++ b/charts/kube-state-metrics/values.yaml @@ -56,6 +56,10 @@ service: port: 8080 # Default to clusterIP for backward compatibility type: ClusterIP + ipDualStack: + enabled: false + ipFamilies: ["IPv6", "IPv4"] + ipFamilyPolicy: "PreferDualStack" nodePort: 0 loadBalancerIP: "" # Only allow access to the loadBalancerIP from these IPs