Skip to content

Commit

Permalink
Fix Prometheus metrics handling for the operator.
Browse files Browse the repository at this point in the history
The current state of the Helm chart is slightly confusing, because:
- there's no easy way to really disable prometheus metrics --
  `--enable-prometheus-metrics` defaults to true anthe current code
  either emits `--enable-prometheus-metrics=true` or nothing at all
  (making it `true` once again).
- The `http` container port is actually a `metrics` port (by convention
  from .e.g. webhook), but is present regardless of whether Prometheus
  metrics are enabled or not. To make it less confusing, this PR
  proposes renaming it.

Signed-off-by: Milan Plzik <milan.plzik@grafana.com>
  • Loading branch information
mplzik committed Oct 30, 2023
1 parent dd9c890 commit 0ab691b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions keda/templates/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ spec:
- "--metrics-server-service-name={{ .Values.operator.name }}-metrics-apiserver"
- "--webhooks-service-name={{ .Values.webhooks.name }}"
- "--k8s-cluster-domain={{ .Values.clusterDomain }}"
- "--enable-prometheus-metrics={{ .Values.prometheus.operator.enabled }}"
{{- if .Values.prometheus.operator.enabled }}
- "--metrics-bind-address=:{{ .Values.prometheus.operator.port }}"
- "--enable-prometheus-metrics={{ .Values.prometheus.operator.enabled }}"
{{- end }}
{{- if .Values.opentelemetry.operator.enabled }}
- "--enable-opentelemetry-metrics={{ .Values.opentelemetry.operator.enabled}}"
Expand Down Expand Up @@ -116,9 +116,11 @@ spec:
failureThreshold: {{ .Values.operator.readinessProbe.failureThreshold }}
successThreshold: {{ .Values.operator.readinessProbe.successThreshold }}
ports:
- containerPort: 8080
name: http
{{- if .Values.prometheus.operator.enabled }}
- containerPort: {{ .Values.prometheus.operator.port }}
name: metrics
protocol: TCP
{{- end }}
env:
- name: WATCH_NAMESPACE
value: {{ .Values.watchNamespace | quote }}
Expand Down

0 comments on commit 0ab691b

Please sign in to comment.