11credential :
2- - name : INTERNAL_LISTENERS
3- value : {{ include "kafka.kraft.internelListeners" . }}
4-
52 - name : PROTOCOL_MAP
63 value : {{ include "kafka.securityProtocolMap" . }}
74
5+ - name : CLIENT_DOMAIN
6+ value : {{ template "common.names.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
7+
8+ - name : CLIENT_HOST
9+ valueFrom :
10+ serviceRef :
11+ name : {{ template "common.names.fullname" . }}
12+ jsonpath : ' { .spec.clusterIP }'
13+
14+ - name : CLIENT_PORT
15+ valueFrom :
16+ serviceRef :
17+ name : {{ template "common.names.fullname" . }}
18+ jsonpath : ' { .spec.ports[?(@.name=="tcp-client")].port }'
19+
20+ {{- if (eq .Values.service.type "LoadBalancer") }}
21+ - name : EXTERNAL_CLIENT_HOST
22+ valueFrom :
23+ serviceRef :
24+ name : {{ template "common.names.fullname" . }}
25+ jsonpath : ' { .status.loadBalancer.ingress[*].ip }'
26+ {{- end }}
27+
28+ {{- if .Values.externalAccess.enabled }}
29+ - name : EXTERNAL_CLIENT_PORT
30+ valueFrom :
31+ serviceRef :
32+ name : {{ template "common.names.fullname" . }}
33+ jsonpath : ' { .spec.ports[?(@.name=="tcp-external")].port }'
34+ {{- end }}
35+
36+
37+ {{- range $i, $internelListeners := ( splitList "," ( include "kafka.kraft.internelListeners" . ) )}}
38+ - name : {{ printf "KAFKA_NODE_%d" $i }}
39+ value : {{ $internelListeners }}
40+ {{- end }}
41+
42+ - name : KAFKA_PORT
43+ valueFrom :
44+ serviceRef :
45+ name : {{ template "common.names.fullname" . }}
46+ jsonpath : ' { .spec.ports[?(@.name=="tcp-client")].port }'
47+
848 {{- if (include "kafka.saslUserPasswordsEnabled" .) }}
949 {{- if (include "kafka.client.saslEnabled" .) }}
1050 - name : CLIENT_USERS
@@ -15,14 +55,9 @@ credential:
1555 secretKeyRef :
1656 name : {{ printf "%s-user-passwords" (include "common.names.fullname" .) }}
1757 jsonpath : ' { .data.client-passwords }'
18-
19- - name : SYSTEM_USER_PASSPORT
20- valueFrom :
21- secretKeyRef :
22- name : {{ printf "%s-user-passwords" (include "common.names.fullname" .) }}
23- jsonpath : ' { .data.system-user-password }'
2458 {{- end }}
2559
60+
2661 {{- if regexFind "SASL" (upper .Values.listeners.interbroker.protocol) }}
2762 - name : INTER_BROKER_PASSWORDS
2863 valueFrom :
@@ -40,18 +75,17 @@ credential:
4075 {{- end }}
4176 {{- end }}
4277
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-controller-%d" (printf "%s" $fullname) $i }}
48- - name : {{ printf "EXTERNAL_%d" $i }}
78+ {{- if .Values.externalAccess.enabled }}
79+ {{- $fullname := include "common.names.fullname" . }}
80+ {{- $replicaCount := .Values.controller.replicaCount | int }}
81+ {{- range $i := until $replicaCount }}
82+ - name : {{ printf "EXTERNAL_KAFKA_NODE_%d" $i }}
4983 valueFrom :
5084 serviceRef :
5185 name : {{ printf "%s-controller-%d-external" (include "common.names.fullname" $) $i | trunc 63 | trimSuffix "-" }}
5286 jsonpath : ' { .status.loadBalancer.ingress[*].ip }'
53- {{- end }}
87+ {{- end }}
5488
55- - name : EXTERNAL_PORT
89+ - name : EXTERNAL_KAFKA_PORT
5690 value : {{ .Values.externalAccess.controller.service.ports.external }}
5791{{- end }}
0 commit comments