11credential :
2- {{- if (eq .Values.service.type "LoadBalancer") }}
3- - name : EXTERNAL_HOST
4- valueFrom :
5- serviceRef :
6- name : {{ template "common.names.fullname" . }}
7- jsonpath : ' { .status.loadBalancer.ingress[*].ip }'
8- {{- end }}
9-
10- - name : CLIENT_HOST
11- valueFrom :
12- serviceRef :
13- name : {{ template "common.names.fullname" . }}
14- jsonpath : ' { .spec.clusterIP }'
2+ - name : INTERNAL_LISTENERS
3+ value : {{ include "kafka.kraft.internelListeners" . }}
154
16- - name : CLIENT_PORT
17- valueFrom :
18- serviceRef :
19- name : {{ template "common.names.fullname" . }}
20- jsonpath : ' { .spec.ports[?(@.name=="tcp-client")].port }'
5+ - name : PROTOCOL_MAP
6+ value : {{ include "kafka.securityProtocolMap" . }}
217
22- {{- if .Values.externalAccess.enabled }}
23- - name : EXTERNAL_PORT
24- valueFrom :
25- serviceRef :
26- name : {{ template "common.names.fullname" . }}
27- jsonpath : ' { .spec.ports[?(@.name=="tcp-external")].port }'
28- {{- end }}
29-
30-
31- {{- if (include "kafka.createSaslSecret" .) }}
328 {{- if (include "kafka.saslUserPasswordsEnabled" .) }}
9+ {{- if (include "kafka.client.saslEnabled" .) }}
3310 - name : CLIENT_USERS
3411 value : {{ join "," .Values.sasl.client.users | quote }}
3512
@@ -45,4 +22,36 @@ credential:
4522 name : {{ printf "%s-user-passwords" (include "common.names.fullname" .) }}
4623 jsonpath : ' { .data.system-user-password }'
4724 {{- end }}
25+
26+ {{- if regexFind "SASL" (upper .Values.listeners.interbroker.protocol) }}
27+ - name : INTER_BROKER_PASSPORTS
28+ valueFrom :
29+ secretKeyRef :
30+ name : {{ printf "%s-user-passwords" (include "common.names.fullname" .) }}
31+ jsonpath : ' { .data.inter-broker-password }'
32+ {{- end }}
33+
34+ {{- if regexFind "SASL" (upper .Values.listeners.controller.protocol) }}
35+ - name : CONTROLLER_PASSPORTS
36+ valueFrom :
37+ secretKeyRef :
38+ name : {{ printf "%s-user-passwords" (include "common.names.fullname" .) }}
39+ jsonpath : ' { .data.controller-password }'
4840 {{- end }}
41+ {{- end }}
42+
43+ {{- if .Values.externalAccess.enabled }}
44+ {{- $fullname := include "common.names.fullname" . }}
45+ {{- $replicaCount := .Values.controller.replicaCount | int }}
46+ {{- range $i := until $replicaCount }}
47+ {{- $targetPod := printf "%s-broker-%d" (printf "%s" $fullname) $i }}
48+ - name : {{ printf "EXTERNAL_%d" $i }}
49+ valueFrom :
50+ serviceRef :
51+ name : {{ printf "%s-broker-%d-external" (include "common.names.fullname" $) $i | trunc 63 | trimSuffix "-" }}
52+ jsonpath : ' { .status.loadBalancer.ingress[*].ip }'
53+ {{- end }}
54+
55+ - name : EXTERNAL_PORT
56+ value : {{ .Values.externalAccess.controller.service.ports.external }}
57+ {{- end }}
0 commit comments