From 333e1146c60b7160bb3ba168fdedf792a672797c Mon Sep 17 00:00:00 2001 From: ethan wolf Date: Fri, 9 Mar 2018 01:16:02 -0700 Subject: [PATCH 1/5] Support exposing jmx and additional ports (for example, prometheus as a java agent) --- incubator/kafka/Chart.yaml | 2 +- incubator/kafka/README.md | 2 ++ incubator/kafka/templates/statefulset.yaml | 11 +++++++++++ incubator/kafka/values.yaml | 8 ++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index 161417794488..f3adfa9d93be 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.4.1 +version: 0.4.2 keywords: - kafka - zookeeper diff --git a/incubator/kafka/README.md b/incubator/kafka/README.md index c101b80288ca..3f43dd7af094 100644 --- a/incubator/kafka/README.md +++ b/incubator/kafka/README.md @@ -70,6 +70,8 @@ following configurable parameters: | `external.domain` | Domain in which to advertise Kafka external listeners. | `cluster.local` | | `external.init` | External init container settings. | (see `values.yaml`) | | `configurationOverrides` | `Kafka ` [configuration setting][brokerconfigs] overrides in the dictionary format | `{ offsets.topic.replication.factor: 3 }` | +| `jmxPort` | The jmx port to use for brokers. Will expose both the port and set the KAFKA_JMX_PORT env variable. | blank | +| `additionsPorts` | Additional ports to expose on brokers. Useful when the image exposes metrics (like prometheus, etc.) through a javaagent instead of a sidecar | `{}` | | `updateStrategy` | StatefulSet update strategy to use. | `{ type: "OnDelete" }` | | `persistence.enabled` | Use a PVC to persist data | `true` | | `persistence.size` | Size of data volume | `1Gi` | diff --git a/incubator/kafka/templates/statefulset.yaml b/incubator/kafka/templates/statefulset.yaml index a47a61c69919..4ec1b28d2d8e 100644 --- a/incubator/kafka/templates/statefulset.yaml +++ b/incubator/kafka/templates/statefulset.yaml @@ -78,6 +78,13 @@ spec: name: external-{{ $i }} {{- end }} {{- end }} + {{- if .Values.jmxPort }} + - containerPort: {{ .Values.jmxPort }} + name: jmx + {{- end }} + {{- if .Values.additionalPorts }} +{{ toYaml .Values.additionalPorts | indent 8 }} + {{- end }} resources: {{ toYaml .Values.resources | indent 10 }} env: @@ -102,6 +109,10 @@ spec: name: "{{ $configMapName }}" key: {{ $configName }} {{- end }} + {{- if .Values.jmxPort }} + - name: KAFKA_JMX_PORT + value: "{{ .Values.jmxPort }}" + {{- end }} # This is required because the Downward API does not yet support identification of # pod numbering in statefulsets. Thus, we are required to specify a command which # allows us to extract the pod ID for usage as the Kafka Broker ID. diff --git a/incubator/kafka/values.yaml b/incubator/kafka/values.yaml index 10cd37f3754e..88a63ac82c66 100644 --- a/incubator/kafka/values.yaml +++ b/incubator/kafka/values.yaml @@ -83,6 +83,14 @@ configurationOverrides: # "listener.security.protocol.map": |- # PLAINTEXT:PLAINTEXT,EXTERNAL:PLAINTEXT +## The jmx port to use for brokers. Will expose both the port and set the KAFKA_JMX_PORT env variable +# jmxPort: 9998 + +## A collection of additional ports to expose on brokers (formatted as normal containerPort yaml) +# Useful when the image exposes metrics (like prometheus, etc.) through a javaagent instead of a sidecar +additionalPorts: {} + + ## Persistence configuration. Specify if and how to persist data to a persistent volume. ## persistence: From 86f803c465417a3e5fcefc6271801956b373fa4c Mon Sep 17 00:00:00 2001 From: ethan wolf Date: Tue, 20 Mar 2018 06:44:23 -0600 Subject: [PATCH 2/5] Increment chart version --- incubator/kafka/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index 88a672aa26c5..371d07e19273 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.4.3 +version: 0.4.4 keywords: - kafka - zookeeper From 120814714f9388feb0ff112fa14615a85a1b5d9e Mon Sep 17 00:00:00 2001 From: ethan wolf Date: Thu, 22 Mar 2018 09:18:55 -0600 Subject: [PATCH 3/5] FIx typo/formatting --- incubator/kafka/README.md | 2 +- incubator/kafka/values.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/incubator/kafka/README.md b/incubator/kafka/README.md index 71f46fe36f45..3b9a3e304637 100644 --- a/incubator/kafka/README.md +++ b/incubator/kafka/README.md @@ -72,7 +72,7 @@ following configurable parameters: | `external.init` | External init container settings. | (see `values.yaml`) | | `configurationOverrides` | `Kafka ` [configuration setting][brokerconfigs] overrides in the dictionary format | `{ offsets.topic.replication.factor: 3 }` | | `jmxPort` | The jmx port to use for brokers. Will expose both the port and set the KAFKA_JMX_PORT env variable. | blank | -| `additionsPorts` | Additional ports to expose on brokers. Useful when the image exposes metrics (like prometheus, etc.) through a javaagent instead of a sidecar | `{}` | +| `additionalPorts` | Additional ports to expose on brokers. Useful when the image exposes metrics (like prometheus, etc.) through a javaagent instead of a sidecar | `{}` | | `updateStrategy` | StatefulSet update strategy to use. | `{ type: "OnDelete" }` | | `persistence.enabled` | Use a PVC to persist data | `true` | | `persistence.size` | Size of data volume | `1Gi` | diff --git a/incubator/kafka/values.yaml b/incubator/kafka/values.yaml index 22399cb94508..9a4e3fcc765d 100644 --- a/incubator/kafka/values.yaml +++ b/incubator/kafka/values.yaml @@ -100,7 +100,6 @@ configurationOverrides: # Useful when the image exposes metrics (like prometheus, etc.) through a javaagent instead of a sidecar additionalPorts: {} - ## Persistence configuration. Specify if and how to persist data to a persistent volume. ## persistence: From 5f4c13353bfab6fa98a6302cf7f3bb5ba8006e3a Mon Sep 17 00:00:00 2001 From: ethan wolf Date: Thu, 22 Mar 2018 09:21:04 -0600 Subject: [PATCH 4/5] Up chart version --- incubator/kafka/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index 371d07e19273..a2e6cc94f493 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.4.4 +version: 0.4.5 keywords: - kafka - zookeeper From cfbb5599793e88b711822336b6fc4789bc394563 Mon Sep 17 00:00:00 2001 From: ethan wolf Date: Thu, 22 Mar 2018 16:02:26 -0600 Subject: [PATCH 5/5] Up chart version --- incubator/kafka/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index a2e6cc94f493..274265b0b23b 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.4.5 +version: 0.4.6 keywords: - kafka - zookeeper