From 3af7233b4668fb663dd6477a8822a280971c20f3 Mon Sep 17 00:00:00 2001 From: Josh Souza Date: Fri, 8 Dec 2023 12:28:21 -0800 Subject: [PATCH] Make metrics exposable based on helm variables --- charts/zookeeper-operator/templates/operator.yaml | 5 +++-- charts/zookeeper-operator/values.yaml | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/zookeeper-operator/templates/operator.yaml b/charts/zookeeper-operator/templates/operator.yaml index eb8223adc..eeeaeb536 100644 --- a/charts/zookeeper-operator/templates/operator.yaml +++ b/charts/zookeeper-operator/templates/operator.yaml @@ -33,12 +33,13 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - - containerPort: 6000 + - containerPort: {{ int .Values.metricsPort }} name: metrics command: - zookeeper-operator - {{- if .Values.disableFinalizer }} args: + - -metrics-bind-address={{ .Values.metricsBindAddress }}:{{ int .Values.metricsPort }} + {{- if .Values.disableFinalizer }} - -disableFinalizer {{- end }} env: diff --git a/charts/zookeeper-operator/values.yaml b/charts/zookeeper-operator/values.yaml index afc8397e3..3830f81f0 100644 --- a/charts/zookeeper-operator/values.yaml +++ b/charts/zookeeper-operator/values.yaml @@ -86,3 +86,7 @@ additionalVolumes: {} # emptyDir: {} disableFinalizer: false + +## In order to enable gathering metrics by Prometheus etc... bind to 0.0.0.0 +metricsBindAddress: 127.0.0.1 +metricsPort: "6000"