Skip to content

Commit

Permalink
[kube-prometheus-stack]add support for dual stack clusters (#4472)
Browse files Browse the repository at this point in the history
  • Loading branch information
M0NsTeRRR authored Apr 19, 2024
1 parent 02e7a20 commit a20c24e
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 58.1.3
version: 58.2.0
appVersion: v0.73.1
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ spec:
timeoutSeconds: {{ .Values.alertmanager.service.sessionAffinityConfig.clientIP.timeoutSeconds }}
{{- end }}
type: "{{ .Values.alertmanager.service.type }}"
{{- if .Values.alertmanager.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.alertmanager.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.alertmanager.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
namespace: kube-system
spec:
clusterIP: None
{{- if .Values.coreDns.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.coreDns.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.coreDns.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
ports:
- name: {{ .Values.coreDns.serviceMonitor.port }}
port: {{ .Values.coreDns.service.port }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
namespace: kube-system
spec:
clusterIP: None
{{- if .Values.kubeControllerManager.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.kubeControllerManager.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.kubeControllerManager.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
ports:
- name: {{ .Values.kubeControllerManager.serviceMonitor.port }}
{{- $kubeControllerManagerDefaultInsecurePort := 10252 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
namespace: kube-system
spec:
clusterIP: None
{{- if .Values.kubeDns.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.kubeDns.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.kubeDns.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
ports:
- name: http-metrics-dnsmasq
port: {{ .Values.kubeDns.service.dnsmasq.port }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
namespace: kube-system
spec:
clusterIP: None
{{- if .Values.kubeEtcd.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.kubeEtcd.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.kubeEtcd.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
ports:
- name: {{ .Values.kubeEtcd.serviceMonitor.port }}
port: {{ .Values.kubeEtcd.service.port }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
namespace: kube-system
spec:
clusterIP: None
{{- if .Values.kubeProxy.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.kubeProxy.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.kubeProxy.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
ports:
- name: {{ .Values.kubeProxy.serviceMonitor.port }}
port: {{ .Values.kubeProxy.service.port }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
namespace: kube-system
spec:
clusterIP: None
{{- if .Values.kubeScheduler.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.kubeScheduler.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.kubeScheduler.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
ports:
- name: {{ .Values.kubeScheduler.serviceMonitor.port }}
{{- $kubeSchedulerDefaultInsecurePort := 10251 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ spec:
{{- if .Values.prometheusOperator.admissionWebhooks.deployment.service.clusterIP }}
clusterIP: {{ .Values.prometheusOperator.admissionWebhooks.deployment.service.clusterIP }}
{{- end }}
{{- if .Values.prometheusOperator.admissionWebhooks.deployment.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.prometheusOperator.admissionWebhooks.deployment.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.prometheusOperator.admissionWebhooks.deployment.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if .Values.prometheusOperator.admissionWebhooks.deployment.service.externalIPs }}
externalIPs:
{{ toYaml .Values.prometheusOperator.admissionWebhooks.deployment.service.externalIPs | indent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ spec:
{{- if .Values.prometheusOperator.service.clusterIP }}
clusterIP: {{ .Values.prometheusOperator.service.clusterIP }}
{{- end }}
{{- if .Values.prometheusOperator.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.prometheusOperator.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.prometheusOperator.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if .Values.prometheusOperator.service.externalIPs }}
externalIPs:
{{ toYaml .Values.prometheusOperator.service.externalIPs | indent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec:
{{- if .Values.prometheus.service.clusterIP }}
clusterIP: {{ .Values.prometheus.service.clusterIP }}
{{- end }}
{{- if .Values.prometheus.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.prometheus.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.prometheus.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if .Values.prometheus.service.externalIPs }}
externalIPs:
{{ toYaml .Values.prometheus.service.externalIPs | indent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ metadata:
spec:
type: {{ .Values.prometheus.thanosService.type }}
clusterIP: {{ .Values.prometheus.thanosService.clusterIP }}
{{- if .Values.prometheus.thanosService.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.prometheus.thanosService.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.prometheus.thanosService.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if ne .Values.prometheus.thanosService.type "ClusterIP" }}
externalTrafficPolicy: {{ .Values.prometheus.thanosService.externalTrafficPolicy }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ items:
{{- if $serviceValues.clusterIP }}
clusterIP: {{ $serviceValues.clusterIP }}
{{- end }}
{{- if $serviceValues.ipDualStack.enabled }}
ipFamilies: {{ toYaml $serviceValues.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ $serviceValues.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if $serviceValues.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := $serviceValues.loadBalancerSourceRanges }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ spec:
{{- if .Values.thanosRuler.service.clusterIP }}
clusterIP: {{ .Values.thanosRuler.service.clusterIP }}
{{- end }}
{{- if .Values.thanosRuler.service.ipDualStack.enabled }}
ipFamilies: {{ toYaml .Values.thanosRuler.service.ipDualStack.ipFamilies | nindent 4 }}
ipFamilyPolicy: {{ .Values.thanosRuler.service.ipDualStack.ipFamilyPolicy }}
{{- end }}
{{- if .Values.thanosRuler.service.externalIPs }}
externalIPs:
{{ toYaml .Values.thanosRuler.service.externalIPs | indent 4 }}
Expand Down
63 changes: 63 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ alertmanager:
annotations: {}
labels: {}
clusterIP: ""
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## Port for Alertmanager Service to listen on
##
Expand Down Expand Up @@ -1454,6 +1458,10 @@ kubeControllerManager:
##
port: null
targetPort: null
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
# selector:
# component: kube-controller-manager

Expand Down Expand Up @@ -1540,6 +1548,11 @@ coreDns:
enabled: true
port: 9153
targetPort: 9153

ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
# selector:
# k8s-app: kube-dns
serviceMonitor:
Expand Down Expand Up @@ -1616,6 +1629,10 @@ kubeDns:
skydns:
port: 10055
targetPort: 10055
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
# selector:
# k8s-app: kube-dns
serviceMonitor:
Expand Down Expand Up @@ -1713,6 +1730,10 @@ kubeEtcd:
enabled: true
port: 2381
targetPort: 2381
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
# selector:
# component: etcd

Expand Down Expand Up @@ -1817,6 +1838,10 @@ kubeScheduler:
##
port: null
targetPort: null
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
# selector:
# component: kube-scheduler

Expand Down Expand Up @@ -1910,6 +1935,10 @@ kubeProxy:
enabled: true
port: 10249
targetPort: 10249
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
# selector:
# k8s-app: kube-proxy

Expand Down Expand Up @@ -2080,6 +2109,10 @@ prometheus-node-exporter:
- --collector.filesystem.fs-types-exclude=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$
service:
portName: http-metrics
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"
prometheus:
monitor:
enabled: true
Expand Down Expand Up @@ -2233,6 +2266,10 @@ prometheusOperator:
annotations: {}
labels: {}
clusterIP: ""
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## Port to expose on each node
## Only used if service.type is 'NodePort'
Expand Down Expand Up @@ -2521,6 +2558,10 @@ prometheusOperator:
annotations: {}
labels: {}
clusterIP: ""
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## Port to expose on each node
## Only used if service.type is 'NodePort'
Expand Down Expand Up @@ -2898,6 +2939,13 @@ prometheus:
##
type: ClusterIP

## Service dual stack
##
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## gRPC port config
portName: grpc
port: 10901
Expand Down Expand Up @@ -2980,6 +3028,10 @@ prometheus:
annotations: {}
labels: {}
clusterIP: ""
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## Port for Prometheus Service to listen on
##
Expand Down Expand Up @@ -3072,6 +3124,13 @@ prometheus:
##
type: ClusterIP

## Service dual stack
##
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## Configure pod disruption budgets for Prometheus
## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
##
Expand Down Expand Up @@ -4217,6 +4276,10 @@ thanosRuler:
annotations: {}
labels: {}
clusterIP: ""
ipDualStack:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

## Port for ThanosRuler Service to listen on
##
Expand Down

0 comments on commit a20c24e

Please sign in to comment.