Skip to content

Commit 6c3c3f6

Browse files
committed
Add support for defining key names used for existing SASL and TSL Secrets; also fix documentation for SASL and TSL existingSecret paths
1 parent 3ad8e4f commit 6c3c3f6

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ helm install --name=kafka-minion kafka-minion/kafka-minion
3333
| `kafka.brokers` | Comma delimited list of brokers to connect to | (none) |
3434
| `kafka.sasl.enabled` | Bool to enable/disable SASL authentication (only SASL_PLAINTEXT is supported) | `false` |
3535
| `kafka.sasl.useHandshake` | Whether or not to send the Kafka SASL handshake first | `true` |
36-
| `kafka.sasl.credentials.existingSecret` | Secretname of an existing secret which contains SASL credentials | (none) |
36+
| `kafka.sasl.existingSecret` | Secretname of an existing secret which contains SASL credentials | (none) |
37+
| `kafka.sasl.existing.username` | Keyname of an existing key on an existing secret which contains SASL username | `username` |
38+
| `kafka.sasl.existing.password` | Keyname of an existing key on an existing secret which contains SASL password | `password` |
3739
| `kafka.sasl.credentials.username` | SASL username | (none) |
3840
| `kafka.sasl.credentials.password` | SASL password | (none) |
3941
| `kafka.tls.enabled` | Whether or not to use TLS when connecting to the broker | `false` |
4042
| `kafka.tls.insecureSkipTlsVerify` | If true, TLS accepts any certificate presented by the server and any host name in that certificate. | `true` |
41-
| `kafka.tls.certificates.existingSecret` | Secretname of an existing secret which contains TLS certificates | (none) |
43+
| `kafka.tls.existingSecret` | Secretname of an existing secret which contains TLS certificates | (none) |
44+
| `kafka.tls.existing.ca` | Keyname of an existing key on an existing secret which contains TLS CA | `tls.ca` |
45+
| `kafka.tls.existing.cert` | Keyname of an existing key on an existing secret which contains TLS Cert | `tls.crt` |
46+
| `kafka.tls.existing.key` | Keyname of an existing key on an existing secret which contains TLS Key | `tls.key` |
47+
| `kafka.tls.existing.passphrase` | Keyname of an existing key on an existing secret which contains Key to decrypt TLS key| `passphrase` |
4248
| `kafka.tls.certificates.ca` | TLS CA | (none) |
4349
| `kafka.tls.certificates.cert` | TLS Cert | (none) |
4450
| `kafka.tls.certificates.key` | TLS Key | (none) |
@@ -56,11 +62,11 @@ helm install --name=kafka-minion kafka-minion/kafka-minion
5662

5763
## SASL/SSL Setup
5864

59-
When configuring SASL or TLS you can either provide the secretname of an existing secret **or** pass the contents as values. When you choose to create the secrets on your own, please make sure you comply with the key names used in this chart:
65+
When configuring SASL or TLS you can either provide the secretname of an existing secret **or** pass the contents as values. When you choose to create the secrets on your own, please make sure you comply with the key names defined in this chart:
6066

6167
#### SASL
6268

63-
Key names are `username` and `password`.
69+
Key names are `username` and `password` by default.
6470

6571
```yml
6672
type: Opaque
@@ -71,7 +77,7 @@ data:
7177
7278
#### TLS
7379
74-
Key names are `tls.ca`, `tls.key`, `tls.crt` and `passphrase`.
80+
Key names are `tls.ca`, `tls.key`, `tls.crt` and `passphrase` by default.
7581

7682
```yml
7783
type: Opaque

kafka-minion/templates/deployment.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,29 +78,29 @@ spec:
7878
valueFrom:
7979
secretKeyRef:
8080
name: "{{ template "kafka-minion.saslSecretName" . }}"
81-
key: username
81+
key: {{ .Values.kafka.sasl.existing.username }}
8282
- name: KAFKA_SASL_PASSWORD
8383
valueFrom:
8484
secretKeyRef:
8585
name: "{{ template "kafka-minion.saslSecretName" . }}"
86-
key: password
86+
key: {{ .Values.kafka.sasl.existing.password }}
8787
- name: KAFKA_SASL_USE_HANDSHAKE
8888
value: {{ .Values.kafka.sasl.useHandshake | quote }}
8989
{{- end }}
9090
- name: KAFKA_TLS_ENABLED
9191
value: {{ .Values.kafka.tls.enabled | quote }}
9292
{{- if .Values.kafka.tls.enabled }}
9393
- name: KAFKA_TLS_CA_FILE_PATH
94-
value: /etc/kafka-secrets/tls.ca
94+
value: /etc/kafka-secrets/{{ .Values.kafka.tls.existing.ca }}
9595
- name: KAFKA_TLS_KEY_FILE_PATH
96-
value: /etc/kafka-secrets/tls.key
96+
value: /etc/kafka-secrets/{{ .Values.kafka.tls.existing.key }}
9797
- name: KAFKA_TLS_CERT_FILE_PATH
98-
value: /etc/kafka-secrets/tls.crt
98+
value: /etc/kafka-secrets/{{ .Values.kafka.tls.existing.cert }}
9999
- name: KAFKA_TLS_PASSPHRASE
100100
valueFrom:
101101
secretKeyRef:
102102
name: "{{ template "kafka-minion.tlsSecretName" . }}"
103-
key: passphrase
103+
key: {{ .Values.kafka.tls.existing.passphrase }}
104104
- name: KAFKA_TLS_INSECURE_SKIP_TLS_VERIFY
105105
value: {{ .Values.kafka.tls.insecureSkipTlsVerify | quote }}
106106
{{- end }}

kafka-minion/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ kafka:
8080
consumerOffsetsTopic: __consumer_offsets
8181
sasl:
8282
enabled: false
83+
existing:
84+
username: username
85+
password: password
8386
useHandshake: true
8487
credentials: {}
8588
# You can either create the secret yourself or let the helm chart create one for you.
@@ -91,6 +94,11 @@ kafka:
9194
# password: securePass123
9295
tls:
9396
enabled: false
97+
existing:
98+
ca: tls.ca
99+
cert: tls.crt
100+
key: tls.key
101+
passphrase: passphrase
94102
insecureSkipTlsVerify: true
95103
certificates: {}
96104
# You can either create the secret yourself or let the helm chart create one for you.

0 commit comments

Comments
 (0)