diff --git a/charts/kube-prometheus-stack/templates/alertmanager/service.yaml b/charts/kube-prometheus-stack/templates/alertmanager/service.yaml index 83f1ce476901..a8fb80f6f5a8 100644 --- a/charts/kube-prometheus-stack/templates/alertmanager/service.yaml +++ b/charts/kube-prometheus-stack/templates/alertmanager/service.yaml @@ -43,8 +43,11 @@ spec: port: {{ .Values.alertmanager.service.port }} targetPort: {{ .Values.alertmanager.service.targetPort }} protocol: TCP - - appProtocol: http - name: reloader-web + - name: reloader-web + {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} + {{- if semverCompare ">=1.20.0-0" $kubeTargetVersion }} + appProtocol: http + {{- end }} port: 8080 targetPort: reloader-web {{- if .Values.alertmanager.service.additionalPorts }} diff --git a/charts/kube-prometheus-stack/templates/prometheus/service.yaml b/charts/kube-prometheus-stack/templates/prometheus/service.yaml index 86cac063ebb5..ea86fa2ce70a 100644 --- a/charts/kube-prometheus-stack/templates/prometheus/service.yaml +++ b/charts/kube-prometheus-stack/templates/prometheus/service.yaml @@ -42,8 +42,11 @@ spec: {{- end }} port: {{ .Values.prometheus.service.port }} targetPort: {{ .Values.prometheus.service.targetPort }} - - appProtocol: http - name: reloader-web + - name: reloader-web + {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} + {{- if semverCompare "> 1.20.0-0" $kubeTargetVersion }} + appProtocol: http + {{- end }} port: 8080 targetPort: reloader-web {{- if .Values.prometheus.thanosIngress.enabled }}