Skip to content

Commit

Permalink
Support exposing jmx and additional ports (helm#4072)
Browse files Browse the repository at this point in the history
* Support exposing jmx and additional ports (for example, prometheus as a java agent)

* Increment chart version

* FIx typo/formatting

* Up chart version

* Up chart version

Signed-off-by: voron <av@arilot.com>
  • Loading branch information
ethanocentricity authored and voron committed Sep 5, 2018
1 parent f508eb9 commit a96b018
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion incubator/kafka/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions incubator/kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,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 |
| `additionalPorts` | Additional ports to expose on brokers. Useful when the image exposes metrics (like prometheus, etc.) through a javaagent instead of a sidecar | `{}` |
| `readinessProbe.initialDelaySeconds` | Number of seconds before probe is initiated. | `30` |
| `readinessProbe.periodSeconds` | How often (in seconds) to perform the probe. | `10` |
| `readinessProbe.timeoutSeconds` | Number of seconds after which the probe times out. | `5` |
Expand Down
11 changes: 11 additions & 0 deletions incubator/kafka/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,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:
Expand All @@ -105,6 +112,10 @@ spec:
- name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
value: {{ $value | quote }}
{{- 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.
Expand Down
7 changes: 7 additions & 0 deletions incubator/kafka/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ 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:
Expand Down

0 comments on commit a96b018

Please sign in to comment.