From d36d85256703ba999b5e31a439bc61fe4ce8a676 Mon Sep 17 00:00:00 2001 From: guicholeo Date: Thu, 28 Sep 2023 14:23:21 -0500 Subject: [PATCH] Added prometheus port name --- keda/templates/manager/deployment.yaml | 8 +++++--- keda/templates/manager/service.yaml | 2 +- keda/templates/metrics-server/servicemonitor.yaml | 2 +- keda/templates/webhooks/deployment.yaml | 2 +- keda/templates/webhooks/service.yaml | 2 +- keda/values.yaml | 4 ++++ 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/keda/templates/manager/deployment.yaml b/keda/templates/manager/deployment.yaml index 16207714..f9369446 100644 --- a/keda/templates/manager/deployment.yaml +++ b/keda/templates/manager/deployment.yaml @@ -119,12 +119,14 @@ spec: failureThreshold: {{ .Values.operator.readinessProbe.failureThreshold }} successThreshold: {{ .Values.operator.readinessProbe.successThreshold }} ports: - - containerPort: 8080 - name: http - protocol: TCP - containerPort: 9666 name: metricsservice protocol: TCP + {{- if .Values.prometheus.operator.enabled }} + - containerPort: {{ .Values.prometheus.operator.port }} + name: {{ .Values.prometheus.operator.portName }} + protocol: TCP + {{- end }} env: - name: WATCH_NAMESPACE value: {{ .Values.watchNamespace | quote }} diff --git a/keda/templates/manager/service.yaml b/keda/templates/manager/service.yaml index 12c4e75f..cca15760 100644 --- a/keda/templates/manager/service.yaml +++ b/keda/templates/manager/service.yaml @@ -30,7 +30,7 @@ spec: port: 9666 targetPort: 9666 {{- if .Values.prometheus.operator.enabled }} - - name: metrics + - name: {{ .Values.prometheus.operator.portName }} port: {{ .Values.prometheus.operator.port }} targetPort: {{ .Values.prometheus.operator.port }} {{- end }} diff --git a/keda/templates/metrics-server/servicemonitor.yaml b/keda/templates/metrics-server/servicemonitor.yaml index a2a0dfc7..e667aa72 100644 --- a/keda/templates/metrics-server/servicemonitor.yaml +++ b/keda/templates/metrics-server/servicemonitor.yaml @@ -29,7 +29,7 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} endpoints: - - port: {{ .Values.prometheus.metricServer.portName }} + - port: {{ .Values.prometheus.metricServer.serviceMonitor.port }} {{- with .Values.prometheus.metricServer.serviceMonitor.targetPort }} targetPort: {{ . }} {{- end }} diff --git a/keda/templates/webhooks/deployment.yaml b/keda/templates/webhooks/deployment.yaml index 856eb00d..fc81603d 100644 --- a/keda/templates/webhooks/deployment.yaml +++ b/keda/templates/webhooks/deployment.yaml @@ -110,7 +110,7 @@ spec: protocol: TCP {{- if .Values.prometheus.webhooks.enabled }} - containerPort: {{ .Values.prometheus.webhooks.port }} - name: metrics + name: {{ .Values.prometheus.webhooks.portName }} protocol: TCP {{- end }} env: diff --git a/keda/templates/webhooks/service.yaml b/keda/templates/webhooks/service.yaml index 4d933d60..183b4967 100644 --- a/keda/templates/webhooks/service.yaml +++ b/keda/templates/webhooks/service.yaml @@ -32,7 +32,7 @@ spec: protocol: TCP targetPort: {{ .Values.webhooks.port | default 9443 }} {{- if .Values.prometheus.webhooks.enabled }} - - name: {{ .Values.prometheus.webhooks.serviceMonitor.port }} + - name: {{ .Values.prometheus.webhooks.portName }} port: {{ .Values.prometheus.webhooks.port }} targetPort: {{ .Values.prometheus.webhooks.port }} {{- end }} diff --git a/keda/values.yaml b/keda/values.yaml index e6441150..6fd4cfe1 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -563,6 +563,8 @@ prometheus: enabled: false # -- Port used for exposing KEDA Operator prometheus metrics port: 8080 + # -- HTTP port name for exposing KEDA Operator prometheus metrics + portName: metrics serviceMonitor: # -- Enables ServiceMonitor creation for the Prometheus Operator enabled: false @@ -622,6 +624,8 @@ prometheus: enabled: false # -- Port used for exposing KEDA admission webhooks prometheus metrics port: 8080 + # -- HTTP port name for KEDA admission webhooks prometheus metrics + portName: metrics serviceMonitor: # -- Enables ServiceMonitor creation for the Prometheus webhooks enabled: false