Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add strimzi kafka topic helm chart #138

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
22 changes: 16 additions & 6 deletions charts/index.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
apiVersion: v1
entries:
kafka-topics:
- apiVersion: v2
created: "2022-03-29T15:06:52.439287+02:00"
description: A Helm Chart to create Kafka Topics utilizing the Strimzi Topic Operator
digest: ee0816a751f1fc63670bc0c1b51dedad6ada7510361816d4ed39a82d939e54aa
name: kafka-topics
type: application
urls:
- kafka-topics/kafka-topics-0.1.0.tgz
version: 0.1.0
producer-app:
- apiVersion: v1
created: "2022-03-02T07:32:10.5412721+01:00"
created: "2022-03-29T15:06:52.44032+02:00"
description: A helm chart for deploying a Kafka producer application based on
the bakdata KafkaProducerApplication template.
digest: 96f8c871b0a31650be34434be23e2d58b0373e2dcd81bcdfaa249724df927f32
Expand All @@ -12,7 +22,7 @@ entries:
version: 0.1.0
producer-app-cleanup-job:
- apiVersion: v1
created: "2022-03-02T07:32:10.5412721+01:00"
created: "2022-03-29T15:06:52.441082+02:00"
description: A helm chart for deploying a clean up job for a Kafka producer application.
digest: 4fa5a0223590febf043c66579fb48df961ec241f8efcc13e072c64a11f47ccc1
name: producer-app-cleanup-job
Expand All @@ -21,7 +31,7 @@ entries:
version: 0.1.0
rclone-copy:
- apiVersion: v1
created: "2022-03-02T07:32:10.5412721+01:00"
created: "2022-03-29T15:06:52.441975+02:00"
description: A helm chart for rclone copy on Kubernetes.
digest: 837699c6f9d9f7b13f42550356d17c0678998164eade46c884932cbce2b05c86
name: rclone-copy
Expand All @@ -30,7 +40,7 @@ entries:
version: 1.0.0
streams-app:
- apiVersion: v1
created: "2022-03-02T07:32:10.5412721+01:00"
created: "2022-03-29T15:06:52.443165+02:00"
description: A helm chart for deploying a kafka streams application based on the
bakdata KafkaStreamsApplication template.
digest: d284cce7b81645b1061e8ca37554c4c4473de9718b7020c6e356a10d6fa3100f
Expand All @@ -40,12 +50,12 @@ entries:
version: 0.1.0
streams-app-cleanup-job:
- apiVersion: v1
created: "2022-03-02T07:32:10.5412721+01:00"
created: "2022-03-29T15:06:52.443928+02:00"
description: A helm chart for deploying a kafka streams application based on the
bakdata KafkaStreamsApplication template.
digest: b346d1fea47603302dc987c3e08e12fc6be553175a84801ac3dad5032a57ddd7
name: streams-app-cleanup-job
urls:
- streams-app-cleanup-job/streams-app-cleanup-job-0.1.0.tgz
version: 0.1.0
generated: "2022-03-02T07:32:10.5412721+01:00"
generated: "2022-03-29T15:06:52.435691+02:00"
5 changes: 5 additions & 0 deletions charts/kafka-topics/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v2
name: kafka-topics
description: A Helm Chart to create Kafka Topics utilizing the Strimzi Topic Operator
type: application
version: 0.1.0
Binary file added charts/kafka-topics/kafka-topics-0.1.0.tgz
Binary file not shown.
34 changes: 34 additions & 0 deletions charts/kafka-topics/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "kafka-topics.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "kafka-topics.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "kafka-topics.labels" -}}
helm.sh/chart: {{ include "kafka-topics.chart" . }}
{{ include "kafka-topics.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "kafka-topics.selectorLabels" -}}
app.kubernetes.io/name: {{ include "kafka-topics.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/kafka-topics/templates/topics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- $root := . -}}
{{- range .Values.topics }}
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: {{ .name }}
{{- if $root.Values.namespace }}
namespace: {{ $root.Values.namespace }}
{{- end }}
labels:
strimzi.io/cluster: {{ $root.Values.strimziCluster }}
{{- range $key, $value := $root.Values.labels }}
{{ $key }}: {{ $value }}
{{- end }}
{{ include "kafka-topics.labels" $ | nindent 4 }}
philipp94831 marked this conversation as resolved.
Show resolved Hide resolved
spec:
{{- toYaml .spec | nindent 2 }}
{{- if and (not .spec.partitions) ($root.Values.partitions) }}
philipp94831 marked this conversation as resolved.
Show resolved Hide resolved
partitions: {{ $root.Values.partitions }}
{{- end }}
{{- if and (not .spec.replicas) ($root.Values.replicas) }}
replicas: {{ $root.Values.replicas }}
{{- end }}
---
{{- end }}
27 changes: 27 additions & 0 deletions charts/kafka-topics/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Default values for kafka-topics.

nameOverride: kafka-topics
# Optional define namespace for topics
# namespace: example-namespace


strimziCluster: example-cluster

# Labels for all topics
labels: {}

# Default topic config for all topics defined in topics list. You can override the values in the respective topic specs
# partitions: 1
# replicas: 1

# define your topics here, you can find an example for specs here: https://github.com/strimzi/strimzi-kafka-operator/blob/0.28.0/examples/topic/kafka-topic.yaml
topics:
# - name: example-topic
# spec:
# partitions: 1
# replicas: 1
# - name: another-topic
# spec:
# config:
# retention.ms: 7200000
# segment.bytes: 1073741824