Skip to content

Commit

Permalink
Rename streams section to kafka in Helm charts (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 authored Jul 25, 2024
1 parent cc19d5e commit 1a4b565
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 93 deletions.
18 changes: 9 additions & 9 deletions charts/producer-app-cleanup-job/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,25 @@ spec:
env:
- name: ENV_PREFIX
value: {{ .Values.configurationEnvPrefix }}_
{{- range $key, $value := .Values.streams.config }}
{{- range $key, $value := .Values.kafka.config }}
- name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
value: {{ $value | quote }}
{{- end }}
{{- if hasKey .Values.streams "brokers" }}
{{- if hasKey .Values.kafka "brokers" }}
- name: "{{ .Values.configurationEnvPrefix }}_BROKERS"
value: {{ .Values.streams.brokers | quote }}
value: {{ .Values.kafka.brokers | quote }}
{{- end }}
{{- if hasKey .Values.streams "schemaRegistryUrl" }}
{{- if hasKey .Values.kafka "schemaRegistryUrl" }}
- name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL"
value: {{ .Values.streams.schemaRegistryUrl | quote }}
value: {{ .Values.kafka.schemaRegistryUrl | quote }}
{{- end }}
{{- if hasKey .Values.streams "outputTopic" }}
{{- if hasKey .Values.kafka "outputTopic" }}
- name: "{{ .Values.configurationEnvPrefix }}_OUTPUT_TOPIC"
value: {{ .Values.streams.outputTopic | quote }}
value: {{ .Values.kafka.outputTopic | quote }}
{{- end }}
{{- if and (hasKey .Values.streams "extraOutputTopics") (.Values.streams.extraOutputTopics) }}
{{- if and (hasKey .Values.kafka "extraOutputTopics") (.Values.kafka.extraOutputTopics) }}
- name: "{{ .Values.configurationEnvPrefix }}_EXTRA_OUTPUT_TOPICS"
value: "{{- range $key, $value := .Values.streams.extraOutputTopics }}{{ $key }}={{ $value }},{{- end }}"
value: "{{- range $key, $value := .Values.kafka.extraOutputTopics }}{{ $key }}={{ $value }},{{- end }}"
{{- end }}
{{- range $key, $value := .Values.secrets }}
- name: "{{ $key }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/producer-app-cleanup-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ files: {}
# mountPath: app/resources
# content: "foo bar"

streams:
kafka:
# brokers: "test:9092"
# schemaRegistryUrl: "url:1234"
config: {}
Expand Down
14 changes: 7 additions & 7 deletions charts/producer-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ Alternatively, a YAML file that specifies the values for the parameters can be p

### Streams

| Parameter | Description | Default |
|-----------------------------|------------------------------------------------------------------------------------------------------------|---------|
| `streams.brokers` | Comma separated list of Kafka brokers to connect to. | |
| `streams.schemaRegistryUrl` | URL of Schema Registry to connect to. | `null` |
| `streams.config` | Configurations for your [Kafka producer app](https://kafka.apache.org/documentation/#producerconfigs). | `{}` |
| `streams.outputTopic` | Output topic for your producer application. | |
| `streams.extraOutputTopics` | Map of additional named output topics if you need to specify multiple topics with different message types. | `{}` |
| Parameter | Description | Default |
|---------------------------|------------------------------------------------------------------------------------------------------------|---------|
| `kafka.brokers` | Comma separated list of Kafka brokers to connect to. | |
| `kafka.schemaRegistryUrl` | URL of Schema Registry to connect to. | `null` |
| `kafka.config` | Configurations for your [Kafka producer app](https://kafka.apache.org/documentation/#producerconfigs). | `{}` |
| `kafka.outputTopic` | Output topic for your producer application. | |
| `kafka.extraOutputTopics` | Map of additional named output topics if you need to specify multiple topics with different message types. | `{}` |

### Other

Expand Down
18 changes: 9 additions & 9 deletions charts/producer-app/templates/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,25 @@ spec:
env:
- name: ENV_PREFIX
value: {{ .Values.configurationEnvPrefix }}_
{{- range $key, $value := .Values.streams.config }}
{{- range $key, $value := .Values.kafka.config }}
- name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
value: {{ $value | quote }}
{{- end }}
{{- if hasKey .Values.streams "brokers" }}
{{- if hasKey .Values.kafka "brokers" }}
- name: "{{ .Values.configurationEnvPrefix }}_BROKERS"
value: {{ .Values.streams.brokers | quote }}
value: {{ .Values.kafka.brokers | quote }}
{{- end }}
{{- if hasKey .Values.streams "schemaRegistryUrl" }}
{{- if hasKey .Values.kafka "schemaRegistryUrl" }}
- name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL"
value: {{ .Values.streams.schemaRegistryUrl | quote }}
value: {{ .Values.kafka.schemaRegistryUrl | quote }}
{{- end }}
{{- if hasKey .Values.streams "outputTopic" }}
{{- if hasKey .Values.kafka "outputTopic" }}
- name: "{{ .Values.configurationEnvPrefix }}_OUTPUT_TOPIC"
value: {{ .Values.streams.outputTopic | quote }}
value: {{ .Values.kafka.outputTopic | quote }}
{{- end }}
{{- if and (hasKey .Values.streams "extraOutputTopics") (.Values.streams.extraOutputTopics) }}
{{- if and (hasKey .Values.kafka "extraOutputTopics") (.Values.kafka.extraOutputTopics) }}
- name: "{{ .Values.configurationEnvPrefix }}_EXTRA_OUTPUT_TOPICS"
value: "{{- range $key, $value := .Values.streams.extraOutputTopics }}{{ $key }}={{ $value }},{{- end }}"
value: "{{- range $key, $value := .Values.kafka.extraOutputTopics }}{{ $key }}={{ $value }},{{- end }}"
{{- end }}
{{- range $key, $value := .Values.secrets }}
- name: "{{ $key }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/producer-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ resources:
memory: 2G
cpu: 500m

streams:
kafka:
# brokers: "test:9092"
# schemaRegistryUrl: "url:1234"
config: {}
Expand Down
40 changes: 20 additions & 20 deletions charts/streams-app-cleanup-job/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,54 +56,54 @@ spec:
resources:
{{ toYaml .Values.resources | indent 12 }}
args:
{{- if .Values.streams.deleteOutput }}
{{- if .Values.kafka.deleteOutput }}
- clean
{{- else }}
- reset
{{- end }}
env:
- name: ENV_PREFIX
value: {{ .Values.configurationEnvPrefix }}_
{{- range $key, $value := .Values.streams.config }}
{{- range $key, $value := .Values.kafka.config }}
- name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
value: {{ $value | quote }}
{{- end }}
{{- if hasKey .Values.streams "brokers" }}
{{- if hasKey .Values.kafka "brokers" }}
- name: "{{ .Values.configurationEnvPrefix }}_BROKERS"
value: {{ .Values.streams.brokers | quote }}
value: {{ .Values.kafka.brokers | quote }}
{{- end }}
{{- if hasKey .Values.streams "schemaRegistryUrl" }}
{{- if hasKey .Values.kafka "schemaRegistryUrl" }}
- name: "{{ .Values.configurationEnvPrefix }}_SCHEMA_REGISTRY_URL"
value: {{ .Values.streams.schemaRegistryUrl | quote }}
value: {{ .Values.kafka.schemaRegistryUrl | quote }}
{{- end }}
{{- if and (hasKey .Values.streams "inputTopics") (.Values.streams.inputTopics) }}
{{- if and (hasKey .Values.kafka "inputTopics") (.Values.kafka.inputTopics) }}
- name: "{{ .Values.configurationEnvPrefix }}_INPUT_TOPICS"
value: {{ .Values.streams.inputTopics | join "," | quote }}
value: {{ .Values.kafka.inputTopics | join "," | quote }}
{{- end }}
{{- if hasKey .Values.streams "inputPattern" }}
{{- if hasKey .Values.kafka "inputPattern" }}
- name: "{{ .Values.configurationEnvPrefix }}_INPUT_PATTERN"
value: {{ .Values.streams.inputPattern | join "," | quote }}
value: {{ .Values.kafka.inputPattern | join "," | quote }}
{{- end }}
{{- if hasKey .Values.streams "outputTopic" }}
{{- if hasKey .Values.kafka "outputTopic" }}
- name: "{{ .Values.configurationEnvPrefix }}_OUTPUT_TOPIC"
value: {{ .Values.streams.outputTopic | quote }}
value: {{ .Values.kafka.outputTopic | quote }}
{{- end }}
{{- if hasKey .Values.streams "errorTopic" }}
{{- if hasKey .Values.kafka "errorTopic" }}
- name: "{{ .Values.configurationEnvPrefix }}_ERROR_TOPIC"
value: {{ .Values.streams.errorTopic | quote }}
value: {{ .Values.kafka.errorTopic | quote }}
{{- end }}
{{- if and (hasKey .Values.streams "extraOutputTopics") (.Values.streams.extraOutputTopics) }}
{{- if and (hasKey .Values.kafka "extraOutputTopics") (.Values.kafka.extraOutputTopics) }}
- name: "{{ .Values.configurationEnvPrefix }}_EXTRA_OUTPUT_TOPICS"
value: "{{- range $key, $value := .Values.streams.extraOutputTopics }}{{ $key }}={{ $value }},{{- end }}"
value: "{{- range $key, $value := .Values.kafka.extraOutputTopics }}{{ $key }}={{ $value }},{{- end }}"
{{- end }}
{{- $delimiter := ";" }}
{{- if and (hasKey .Values.streams "extraInputTopics") (.Values.streams.extraInputTopics) }}
{{- if and (hasKey .Values.kafka "extraInputTopics") (.Values.kafka.extraInputTopics) }}
- name: "{{ .Values.configurationEnvPrefix }}_EXTRA_INPUT_TOPICS"
value: "{{- range $key, $value := .Values.streams.extraInputTopics }}{{ $key }}={{ $value | join $delimiter }},{{- end }}"
value: "{{- range $key, $value := .Values.kafka.extraInputTopics }}{{ $key }}={{ $value | join $delimiter }},{{- end }}"
{{- end }}
{{- if and (hasKey .Values.streams "extraInputPatterns") (.Values.streams.extraInputPatterns) }}
{{- if and (hasKey .Values.kafka "extraInputPatterns") (.Values.kafka.extraInputPatterns) }}
- name: "{{ .Values.configurationEnvPrefix }}_EXTRA_INPUT_PATTERNS"
value: "{{- range $key, $value := .Values.streams.extraInputPatterns }}{{ $key }}={{ $value }},{{- end }}"
value: "{{- range $key, $value := .Values.kafka.extraInputPatterns }}{{ $key }}={{ $value }},{{- end }}"
{{- end }}
{{- range $key, $value := .Values.secrets }}
- name: "{{ $key }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/streams-app-cleanup-job/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ files: {}
# mountPath: app/resources
# content: "foo bar"

streams:
kafka:
# brokers: "test:9092"
# schemaRegistryUrl: "url:1234"
config: {}
Expand Down
27 changes: 13 additions & 14 deletions charts/streams-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,19 @@ Alternatively, a YAML file that specifies the values for the parameters can be p

### Streams

| Parameter | Description | Default |
|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `streams.brokers` | Comma separated list of Kafka brokers to connect to. | |
| `streams.schemaRegistryUrl` | URL of Schema Registry to connect to. | `null` |
| `streams.staticMembership` | Whether to use [Kafka Static Group Membership](https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances). | `false` |
| `streams.config` | Configurations for your [Kafka Streams app](https://kafka.apache.org/documentation/#streamsconfigs). | `{}` |
| `streams.inputTopics` | List of input topics for your streams application. | `[]` |
| `streams.extraInputTopics` | Map of additional named input topics if you need to specify multiple topics with different message types. | `{}` |
| `streams.inputPattern` | Input pattern of topics for your streams application. | |
| `streams.extraInputPatterns` | Map of additional named input patterns if you need to specify multiple topics with different message types. | `{}` |
| `streams.outputTopic` | Output topic for your streams application. | |
| `streams.extraOutputTopics` | Map of additional named output topics if you need to specify multiple topics with different message types. | `{}` |
| `streams.errorTopic` | Error topic for your streams application. | |
| `streams.productive` | Whether to use Kafka configuration values that are more suitable for production environments. | `true` |
| Parameter | Description | Default |
|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
| `kafka.brokers` | Comma separated list of Kafka brokers to connect to. | |
| `kafka.schemaRegistryUrl` | URL of Schema Registry to connect to. | `null` |
| `kafka.staticMembership` | Whether to use [Kafka Static Group Membership](https://cwiki.apache.org/confluence/display/KAFKA/KIP-345%3A+Introduce+static+membership+protocol+to+reduce+consumer+rebalances). | `false` |
| `kafka.config` | Configurations for your [Kafka Streams app](https://kafka.apache.org/documentation/#streamsconfigs). | `{}` |
| `kafka.inputTopics` | List of input topics for your streams application. | `[]` |
| `kafka.extraInputTopics` | Map of additional named input topics if you need to specify multiple topics with different message types. | `{}` |
| `kafka.inputPattern` | Input pattern of topics for your streams application. | |
| `kafka.extraInputPatterns` | Map of additional named input patterns if you need to specify multiple topics with different message types. | `{}` |
| `kafka.outputTopic` | Output topic for your streams application. | |
| `kafka.extraOutputTopics` | Map of additional named output topics if you need to specify multiple topics with different message types. | `{}` |
| `kafka.errorTopic` | Error topic for your streams application. | |

### Other

Expand Down
Loading

0 comments on commit 1a4b565

Please sign in to comment.