Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: v1
entries:
streams-app:
- apiVersion: v1
created: 2019-07-18T14:12:27.254566+02:00
created: 2019-08-09T08:53:42.928572+02:00
description: A helm chart for deploying a kafka streams application based on the
bakdata KafkaStreamsApplication template.
digest: e8f9b8be5ac33fad33d05a850a2dce9d4443e65222e689d9eacd5eae40e6e315
digest: 7500078f416349e4621219defcd3bcc8eba4125e6a14c6a95509033f4e23d63c
name: streams-app
urls:
- streams-app/streams-app-0.1.0.tgz
version: 0.1.0
generated: 2019-07-18T14:12:27.25317+02:00
generated: 2019-08-09T08:53:42.926068+02:00
Binary file modified charts/streams-app/streams-app-0.1.0.tgz
Binary file not shown.
66 changes: 55 additions & 11 deletions charts/streams-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ spec:
release: {{ .Release.Name }}
template:
metadata:
{{- if .Values.awsRole }}
{{- if or .Values.awsRole .Values.prometheus.jmx.enabled }}
annotations:
{{- if .Values.awsRole }}
iam.amazonaws.com/role: {{ .Values.awsRole }}
{{- end }}
{{- if .Values.prometheus.jmx.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
{{- end }}
{{- end }}
labels:
app: {{ template "streams-app.name" . }}
release: {{ .Release.Name }}
Expand All @@ -33,15 +39,53 @@ spec:
- {{ template "streams-app.name" . }}
topologyKey: "kubernetes.io/hostname"
containers:
- name: {{ template "streams-app.name" . }}-container
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
resources:
{{ toYaml .Values.resources | indent 10 }}
env:
- name: ENV_PREFIX
value: {{ .Values.configurationEnvPrefix }}
- name: {{ template "streams-app.name" . }}-container
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
resources:
{{ toYaml .Values.resources | indent 12 }}
env:
- name: ENV_PREFIX
value: {{ .Values.configurationEnvPrefix }}
{{- range $key, $value := .Values.env }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
- name: {{ $key | quote }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.prometheus.jmx.enabled }}
- name: KAFKA_JMX_PORT
value: "{{ .Values.jmx.port }}"
{{- end }}
- name: JAVA_TOOL_OPTIONS
value: "-Dcom.sun.management.jmxremote.port={{ .Values.jmx.port }} -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
{{- if .Values.prometheus.jmx.enabled }}
ports:
- containerPort: {{ .Values.jmx.port }}
name: jmx
{{- end }}
{{- if .Values.prometheus.jmx.enabled }}
- name: prometheus-jmx-exporter
image: "{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
command:
- java
- -XX:+UnlockExperimentalVMOptions
- -XX:+UseCGroupMemoryLimitForHeap
- -XX:MaxRAMFraction=1
- -XshowSettings:vm
- -jar
- jmx_prometheus_httpserver.jar
- {{ .Values.prometheus.jmx.port | quote }}
- /etc/jmx-streams-app/jmx-kafka-streams-app-prometheus.yml
ports:
- containerPort: {{ .Values.prometheus.jmx.port }}
resources:
{{ toYaml .Values.prometheus.jmx.resources | indent 12 }}
volumeMounts:
- name: jmx-config
mountPath: /etc/jmx-streams-app
{{- end }}
{{- if .Values.prometheus.jmx.enabled }}
volumes:
- name: jmx-config
configMap:
name: {{ template "streams-app.name" . }}-jmx-configmap
{{- end }}
21 changes: 21 additions & 0 deletions charts/streams-app/templates/jmx-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if and .Values.prometheus.jmx.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "streams-app.name" . }}-jmx-configmap
labels:
app: {{ template "streams-app.name" . }}
chart: {{ template "streams-app.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
jmx-kafka-streams-app-prometheus.yml: |+
jmxUrl: service:jmx:rmi:///jndi/rmi://localhost:{{ .Values.jmx.port }}/jmxrmi
lowercaseOutputName: true
lowercaseOutputLabelNames: true
ssl: false
rules:
{{- range .Values.jmx.metricRules}}
- pattern: {{ . | quote }}
{{- end}}
{{- end }}
32 changes: 31 additions & 1 deletion charts/streams-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ resources:
cpu: 200m
memory: 300Mi
limits:
memory: 2G
cpu: 500m
memory: 2G


# env:
# APP_INPUT_TOPIC: "test"
Expand All @@ -25,3 +26,32 @@ resources:
# APP_OUTPUT_SCHEMA: "/test/schema"
# APP_SCHEMA_REGISTRY_URL: "url:1234"

## Monitoring
## Kafka Connect JMX Settings
## ref: https://kafka.apache.org/documentation/#connect_monitoring
jmx:
port: 5555
metricRules:
- ".*"


## Prometheus Exporter Configuration
## ref: https://prometheus.io/docs/instrumenting/exporters/
prometheus:
## JMX Exporter Configuration
## ref: https://github.com/prometheus/jmx_exporter
jmx:
enabled: true
image: solsson/kafka-prometheus-jmx-exporter@sha256
imageTag: 6f82e2b0464f50da8104acd7363fb9b995001ddff77d248379f8788e78946143
port: 5556

## Resources configuration for the JMX exporter container.
## See the `resources` documentation above for details.
resources:
requests:
cpu: 100m
memory: 500Mi
limits:
cpu: 300m
memory: 2G