Skip to content

Commit

Permalink
Fix Prometheus metrics handling for the operator. (kedacore#555)
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>
Signed-off-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
  • Loading branch information
mplzik and JorTurFer committed Jan 18, 2024
1 parent f9098dd commit 8c080b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions keda/templates/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ spec:
- "--webhooks-service-name={{ .Values.webhooks.name }}"
- "--k8s-cluster-name={{ .Values.clusterName }}"
- "--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 @@ -126,12 +126,14 @@ spec:
failureThreshold: {{ .Values.operator.readinessProbe.failureThreshold }}
successThreshold: {{ .Values.operator.readinessProbe.successThreshold }}
ports:
{{- if .Values.prometheus.operator.enabled }}
- containerPort: {{ .Values.prometheus.operator.port }}
name: metrics
protocol: TCP
{{- end }}
- containerPort: 9666
name: metricsservice
protocol: TCP
- containerPort: 8080
name: http
protocol: TCP
env:
- name: WATCH_NAMESPACE
value: {{ .Values.watchNamespace | quote }}
Expand Down

0 comments on commit 8c080b2

Please sign in to comment.