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

added config to set kafka topics as an array #286

Merged
merged 1 commit into from
Jan 24, 2024
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/stream-processors/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ keywords:
- kafka
- strimzi kafka operator
- stream processing
version: 1.3.0
version: 1.4.0
annotations:
artifacthub.io/recommendations: |
- url: https://artifacthub.io/packages/helm/strimzi/strimzi-kafka-operator
- url: https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack
# When using the list of objects option the valid supported kinds are
# added, changed, deprecated, removed, fixed and security.
artifacthub.io/changes: |
- kind: changed
description: refreshed docs with latest helm-docs
- kind: added
description: config option `*.kafka.topics` to set the `KAFKA_TOPICS` env var from an array
5 changes: 5 additions & 0 deletions charts/stream-processors/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ version label value
{{- $tagAsString | quote }}
{{- end }}
{{- end }}

{{- define "stream-processors.utils.joinListWithComma" -}}
{{- $local := dict "first" true -}}
{{- range $k, $v := . -}}{{- if not $local.first -}},{{- end -}}{{- $v -}}{{- $_ := set $local "first" false -}}{{- end -}}
{{- end -}}
12 changes: 12 additions & 0 deletions charts/stream-processors/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,18 @@ spec:
secretKeyRef:
name: {{ $.Values.strimziClusterName }}-cluster-ca-cert
key: ca.password
{{- with .kafka }}
{{- if .topics }}
- name: TOPICS
value: {{ include "stream-processors.utils.joinListWithComma" .topics }}
- name: TOPIC
value: {{ include "stream-processors.utils.joinListWithComma" .topics }}
- name: KAFKA_TOPICS
value: {{ include "stream-processors.utils.joinListWithComma" .topics }}
- name: KAFKA_TOPIC
value: {{ include "stream-processors.utils.joinListWithComma" .topics }}
{{- end }}
{{- end }}
{{- if .container.env -}}
{{- toYaml .container.env | default "" | nindent 12 }}
{{- end }}
Expand Down
5 changes: 5 additions & 0 deletions charts/stream-processors/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ processors:
additionalLabels:
release: prom
replicaCount: 1
kafka:
topics:
- test-1
- test-2
- test-3
container:
image:
registry: ghcr.io
Expand Down
Loading