From 3434a1e1ae4992a4c04b528f36408958aab6b07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Schmitz=20von=20H=C3=BClst?= Date: Fri, 11 Sep 2020 03:54:27 +0200 Subject: [PATCH] Expose the jmx port in service, when jmx is enabled. (#261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * expose jmx exporter port when enabled * change other charts as well Co-authored-by: Moritz Schmitz von Hülst --- charts/cp-kafka-connect/templates/service.yaml | 4 ++++ charts/cp-kafka-rest/templates/service.yaml | 4 ++++ charts/cp-kafka/templates/service.yaml | 6 +++++- charts/cp-ksql-server/templates/service.yaml | 4 ++++ charts/cp-schema-registry/templates/service.yaml | 4 ++++ charts/cp-zookeeper/templates/service.yaml | 6 +++++- 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/charts/cp-kafka-connect/templates/service.yaml b/charts/cp-kafka-connect/templates/service.yaml index 1346f6c8..7ae84c2e 100644 --- a/charts/cp-kafka-connect/templates/service.yaml +++ b/charts/cp-kafka-connect/templates/service.yaml @@ -11,6 +11,10 @@ spec: ports: - name: kafka-connect port: {{ .Values.servicePort }} + {{- if .Values.prometheus.jmx.enabled }} + - name: metrics + port: {{ .Values.prometheus.jmx.port }} + {{- end }} selector: app: {{ template "cp-kafka-connect.name" . }} release: {{ .Release.Name }} diff --git a/charts/cp-kafka-rest/templates/service.yaml b/charts/cp-kafka-rest/templates/service.yaml index 1d415c82..4d9765f9 100644 --- a/charts/cp-kafka-rest/templates/service.yaml +++ b/charts/cp-kafka-rest/templates/service.yaml @@ -11,6 +11,10 @@ spec: ports: - name: rest-proxy port: {{ .Values.servicePort }} + {{- if .Values.prometheus.jmx.enabled }} + - name: metrics + port: {{ .Values.prometheus.jmx.port }} + {{- end }} selector: app: {{ template "cp-kafka-rest.name" . }} release: {{ .Release.Name }} diff --git a/charts/cp-kafka/templates/service.yaml b/charts/cp-kafka/templates/service.yaml index 169d0cc2..28c34129 100644 --- a/charts/cp-kafka/templates/service.yaml +++ b/charts/cp-kafka/templates/service.yaml @@ -11,6 +11,10 @@ spec: ports: - port: 9092 name: broker + {{- if .Values.prometheus.jmx.enabled }} + - port: {{ .Values.prometheus.jmx.port }} + name: metrics + {{- end }} selector: app: {{ template "cp-kafka.name" . }} - release: {{ .Release.Name }} \ No newline at end of file + release: {{ .Release.Name }} diff --git a/charts/cp-ksql-server/templates/service.yaml b/charts/cp-ksql-server/templates/service.yaml index fa0837cf..3faeaa2e 100644 --- a/charts/cp-ksql-server/templates/service.yaml +++ b/charts/cp-ksql-server/templates/service.yaml @@ -11,6 +11,10 @@ spec: ports: - name: ksql-server port: {{ .Values.servicePort }} + {{- if .Values.prometheus.jmx.enabled }} + - name: metrics + port: {{ .Values.prometheus.jmx.port }} + {{- end }} selector: app: {{ template "cp-ksql-server.name" . }} release: {{ .Release.Name }} diff --git a/charts/cp-schema-registry/templates/service.yaml b/charts/cp-schema-registry/templates/service.yaml index 38281a09..f26d01eb 100644 --- a/charts/cp-schema-registry/templates/service.yaml +++ b/charts/cp-schema-registry/templates/service.yaml @@ -11,6 +11,10 @@ spec: ports: - name: schema-registry port: {{ .Values.servicePort }} + {{- if .Values.prometheus.jmx.enabled }} + - name: metrics + port: {{ .Values.prometheus.jmx.port }} + {{- end }} selector: app: {{ template "cp-schema-registry.name" . }} release: {{ .Release.Name }} diff --git a/charts/cp-zookeeper/templates/service.yaml b/charts/cp-zookeeper/templates/service.yaml index 8d97a20b..3a65da77 100644 --- a/charts/cp-zookeeper/templates/service.yaml +++ b/charts/cp-zookeeper/templates/service.yaml @@ -12,6 +12,10 @@ spec: ports: - port: {{ .Values.clientPort }} name: client + {{- if .Values.prometheus.jmx.enabled }} + - name: metrics + port: {{ .Values.prometheus.jmx.port }} + {{- end }} selector: app: {{ template "cp-zookeeper.name" . }} - release: {{ .Release.Name }} \ No newline at end of file + release: {{ .Release.Name }}