From c74fa4f7d770818560a10bcea2d9fac40e19d471 Mon Sep 17 00:00:00 2001 From: Tsubasa Nagasawa Date: Sun, 16 Jun 2024 16:20:52 +0900 Subject: [PATCH] [cni-metrics-helper] Expose container port when enabling prometheus metrics To scrape Prometheus metrics using the Prometheus Operator's PodMonitor, container ports must be exposed via PodSpec. Signed-off-by: Tsubasa Nagasawa --- charts/cni-metrics-helper/templates/deployment.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/charts/cni-metrics-helper/templates/deployment.yaml b/charts/cni-metrics-helper/templates/deployment.yaml index 192ce9e56e..7f7fbb6f4c 100644 --- a/charts/cni-metrics-helper/templates/deployment.yaml +++ b/charts/cni-metrics-helper/templates/deployment.yaml @@ -41,6 +41,11 @@ spec: {{- end }} name: cni-metrics-helper image: "{{- if .Values.image.override }}{{- .Values.image.override }}{{- else }}{{- .Values.image.account }}.dkr.ecr.{{- .Values.image.region }}.{{- .Values.image.domain }}/cni-metrics-helper:{{- .Values.image.tag }}{{- end}}" +{{- if eq (get .Values.env "USE_PROMETHEUS") "true" }} + ports: + - containerPort: 61681 + name: metrics +{{- end }} serviceAccountName: {{ template "cni-metrics-helper.serviceAccountName" . }} {{- with .Values.tolerations }} tolerations: