From d5943ea288f3234a54b2944e70f3dc5281912089 Mon Sep 17 00:00:00 2001 From: Dimitrios Tassopoulos <137508942+dimtas@users.noreply.github.com> Date: Mon, 28 Oct 2024 09:11:14 +0100 Subject: [PATCH] fix: Resolve the double port expose for Prometheus metrics (#333) --- charts/heureka/templates/PodMonitor.yaml | 19 +++++++++++++++++++ charts/heureka/templates/deployment.yaml | 2 -- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 charts/heureka/templates/PodMonitor.yaml diff --git a/charts/heureka/templates/PodMonitor.yaml b/charts/heureka/templates/PodMonitor.yaml new file mode 100644 index 00000000..c7106ce2 --- /dev/null +++ b/charts/heureka/templates/PodMonitor.yaml @@ -0,0 +1,19 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ template "heureka.fullname" . }} + labels: +{{- include "heureka.labels" . | nindent 4 }} + prometheus: kubernetes +spec: + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + + selector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + + podMetricsEndpoints: + - port: http + path: /metrics \ No newline at end of file diff --git a/charts/heureka/templates/deployment.yaml b/charts/heureka/templates/deployment.yaml index dc0398b1..07f14d98 100644 --- a/charts/heureka/templates/deployment.yaml +++ b/charts/heureka/templates/deployment.yaml @@ -68,8 +68,6 @@ spec: - name: http containerPort: {{ .Values.service.port }} protocol: TCP - - name: metrics - containerPort: {{ .Values.service.port }} livenessProbe: httpGet: path: /status