-
Notifications
You must be signed in to change notification settings - Fork 3
Add strimzi kafka topic helm chart #138
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
Open
VictorKuenstler
wants to merge
9
commits into
master
Choose a base branch
from
feat/kafka-topic-helm-chart
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7ca0a24
Add kafka topic helm chart
cf62888
Add configurable default partitions and replicas
87872bc
Remove comments in default values yaml
c96e009
Topic example as comment
42bf32b
Update
91ff71c
Add option to set fallback config for all topics
69c690d
Merge topic configs
ab22549
Support topics without specs
0675f34
Add comment to describe minimum setup
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| {{- $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 }} | ||
| spec: | ||
| {{- range $key, $val := (.spec) -}} | ||
| {{- if not (eq $key "config") }} # ignore config key because we merge it later | ||
| {{ $key }}: {{ $val}} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- if and (not (.spec).partitions) ($root.Values.partitions) }} | ||
| partitions: {{ $root.Values.partitions }} | ||
| {{- end }} | ||
| {{- if and (not (.spec).replicas) ($root.Values.replicas) }} | ||
| replicas: {{ $root.Values.replicas }} | ||
| {{- end }} | ||
| {{- $config := merge ((.spec).config | default dict) ($root.Values.config | default dict) }} | ||
| {{- if $config }} | ||
| config: | ||
| {{ $config | toYaml | nindent 4 }} | ||
| {{- end}} | ||
| --- | ||
| {{- end }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # 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 | ||
| # You must define the number of partitions and replicas here OR in the topic spec. Without defining the number of partitions and replicas, the strimzi topic operator will not create the topic in Kafka | ||
| # partitions: 1 | ||
| # replicas: 1 | ||
| # the configs here are merge with the topic specific confis defined below. The topic specific config will override the configs here if there duplicate keys | ||
| # config: | ||
| # retention.ms: 10000000 | ||
|
|
||
| # 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 | ||
| # - name: third-topic |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.