Skip to content

Commit 5a0b940

Browse files
committed
feat: better handling of kafka auth properties in helm chart
1 parent f21c5b6 commit 5a0b940

File tree

6 files changed

+266
-61
lines changed

6 files changed

+266
-61
lines changed

charts/steadybit-extension-kafka/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: steadybit-extension-kafka
33
description: Steadybit scaffold extension Helm chart for Kubernetes.
4-
version: 1.0.17
4+
version: 1.0.18
55
appVersion: v1.1.0
66
home: https://www.steadybit.com/
77
icon: https://steadybit-website-assets.s3.amazonaws.com/logo-symbol-transparent.png
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
3+
{{- define "kafka.auth.secret.name" -}}
4+
{{- default "steadybit-extension-kakfa" .Values.kafka.auth.existingSecret -}}
5+
{{- end -}}

charts/steadybit-extension-kafka/templates/deployment.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,35 @@ spec:
7070
- name: STEADYBIT_EXTENSION_SEED_BROKERS
7171
value: {{ .Values.kafka.seedBrokers }}
7272
- name: STEADYBIT_EXTENSION_SASL_USER
73-
value: {{ .Values.kafka.auth.saslUser }}
73+
valueFrom:
74+
secretKeyRef:
75+
name: {{ include "kafka.auth.secret.name" . }}
76+
key: saslUser
7477
- name: STEADYBIT_EXTENSION_SASL_PASSWORD
75-
value: {{ .Values.kafka.auth.saslPassword }}
78+
valueFrom:
79+
secretKeyRef:
80+
name: {{ include "kafka.auth.secret.name" . }}
81+
key: saslPassword
7682
- name: STEADYBIT_EXTENSION_SASL_MECHANISM
77-
value: {{ .Values.kafka.auth.saslMechanism }}
83+
valueFrom:
84+
secretKeyRef:
85+
name: {{ include "kafka.auth.secret.name" . }}
86+
key: saslMechanism
7887
- name: STEADYBIT_EXTENSION_KAFKA_CLUSTER_CERT_CHAIN_FILE
79-
value: {{ .Values.kafka.auth.certChainFile }}
88+
valueFrom:
89+
secretKeyRef:
90+
name: {{ include "kafka.auth.secret.name" . }}
91+
key: certChainFile
8092
- name: STEADYBIT_EXTENSION_KAFKA_CLUSTER_CERT_KEY_FILE
81-
value: {{ .Values.kafka.auth.certKeyFile }}
93+
valueFrom:
94+
secretKeyRef:
95+
name: {{ include "kafka.auth.secret.name" . }}
96+
key: certKeyFile
8297
- name: STEADYBIT_EXTENSION_KAFKA_CLUSTER_CA_FILE
83-
value: {{ .Values.kafka.auth.CaFile }}
98+
valueFrom:
99+
secretKeyRef:
100+
name: {{ include "kafka.auth.secret.name" . }}
101+
key: caFile
84102
{{- include "extensionlib.deployment.env" (list .) | nindent 12 }}
85103
{{- with .Values.extraEnv }}
86104
{{- toYaml . | nindent 12 }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if not .Values.kafka.auth.existingSecret -}}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "kafka.auth.secret.name" . }}
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- range $key, $value := .Values.extraLabels }}
9+
{{ $key }}: {{ $value }}
10+
{{- end }}
11+
type: Opaque
12+
data:
13+
saslMechanism: {{ .Values.kafka.auth.saslMechanism | b64enc | quote }}
14+
saslUser: {{ .Values.kafka.auth.saslUser | b64enc | quote }}
15+
saslPassword: {{ .Values.kafka.auth.saslPassword | b64enc | quote }}
16+
certChainFile: {{ .Values.kafka.auth.certChainFile | b64enc | quote }}
17+
certKeyFile: {{ .Values.kafka.auth.certKeyFile | b64enc | quote }}
18+
caFile: {{ .Values.kafka.auth.caFile | b64enc | quote }}
19+
{{- end }}

0 commit comments

Comments
 (0)