2 # Modifications Copyright © 2018 AT&T
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25 release: {{ include "common.release" . }}
26 heritage: {{ .Release.Service }}
30 app: {{ include "common.name" . }}
31 serviceName: {{ .Values.service.name }}
32 replicas: {{ .Values.replicaCount }}
33 podManagementPolicy: Parallel
37 app: {{ include "common.name" . }}
38 release: {{ include "common.release" . }}
39 {{- if .Values.prometheus.jmx.enabled }}
41 prometheus.io/scrape: "true"
42 prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
45 {{- if .Values.nodeAffinity }}
47 {{ toYaml .Values.nodeAffinity | indent 10 }}
50 - name: "{{ include "common.namespace" . }}-docker-registry-key"
52 - name: {{ include "common.name" . }}-initcontainer
53 image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
59 - {{ .Values.zookeeper.name }}
65 fieldPath: metadata.namespace
66 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
67 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 name: {{ include "common.name" . }}-readiness
73 rm -rf '/var/lib/kafka/data/lost+found';
74 chown -R 1000:0 /var/lib/kafka/data;
75 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
76 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
78 - mountPath: /var/lib/kafka/data
80 name: {{ include "common.name" . }}-permission-fixer
85 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/kafka/secrets/jaas/${PFILE}; done"
88 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-client" "key" "login") | indent 10 }}
90 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-client" "key" "password") | indent 10 }}
92 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "kafka-admin" "key" "login") | indent 10 }}
94 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "kafka-admin" "key" "password") | indent 10 }}
96 - mountPath: /etc/kafka/secrets/jaas
98 - mountPath: /config-input
100 image: "{{ .Values.global.envsubstImage }}"
101 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
102 name: {{ include "common.name" . }}-update-config
104 {{- if .Values.prometheus.jmx.enabled }}
105 - name: prometheus-jmx-exporter
106 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
107 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
110 - -XX:+UnlockExperimentalVMOptions
111 - -XX:+UseCGroupMemoryLimitForHeap
112 - -XX:MaxRAMFraction=1
115 - jmx_prometheus_httpserver.jar
116 - {{ .Values.prometheus.jmx.port | quote }}
117 - /etc/jmx-kafka/jmx-kafka-prometheus.yml
119 - containerPort: {{ .Values.prometheus.jmx.port }}
121 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
124 mountPath: /etc/jmx-kafka
126 - name: {{ include "common.name" . }}
127 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
128 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
133 export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
134 {{- if .Values.global.aafEnabled }}
135 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_SASL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_SASL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
137 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
139 exec /etc/confluent/docker/run
141 {{ include "common.resources" . | indent 12 }}
143 - containerPort: {{ .Values.service.internalPort }}
144 - containerPort: {{ .Values.service.externalPort }}
145 {{- if .Values.prometheus.jmx.enabled }}
146 - containerPort: {{ .Values.jmx.port }}
149 {{ if eq .Values.liveness.enabled true }}
152 port: {{ .Values.service.internalPort }}
153 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
154 periodSeconds: {{ .Values.liveness.periodSeconds }}
155 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
159 port: {{ .Values.service.internalPort }}
160 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
161 periodSeconds: {{ .Values.readiness.periodSeconds }}
162 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
168 fieldPath: status.hostIP
169 - name: KAFKA_ZOOKEEPER_CONNECT
170 value: {{ include "common.release" . }}-{{.Values.zookeeper.name}}-0.{{.Values.zookeeper.name}}.{{.Release.Namespace}}.svc.cluster.local:{{.Values.zookeeper.port}},{{ include "common.release" . }}-{{.Values.zookeeper.name}}-1.{{.Values.zookeeper.name}}.{{.Release.Namespace}}.svc.cluster.local:{{.Values.zookeeper.port}},{{ include "common.release" . }}-{{.Values.zookeeper.name}}-2.{{.Values.zookeeper.name}}.{{.Release.Namespace}}.svc.cluster.local:{{.Values.zookeeper.port}}
171 - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
172 value: "{{ .Values.kafka.enableSupport }}"
174 value: "{{ .Values.kafka.jaasOptions }}"
175 {{- if .Values.global.aafEnabled }}
177 value: "{{ .Values.kafka.jaasOptionsAaf }}"
178 - name: aaf_locate_url
179 value: https://aaf-locate.{{ include "common.namespace" . }}:8095
180 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
181 value: "{{ .Values.kafka.protocolMapAaf }}"
182 - name: KAFKA_LISTENERS
183 value: "{{ .Values.kafka.listenersAaf }}"
184 - name: KAFKA_SASL_ENABLED_MECHANISMS
185 value: "{{ .Values.kafka.saslMech }}"
186 - name: KAFKA_INTER_BROKER_LISTENER_NAME
187 value: "{{ .Values.kafka.interBrokerListernerAaf }}"
188 - name: KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL
189 value: "{{ .Values.kafka.saslInterBrokerProtocol }}"
190 - name: KAFKA_AUTHORIZER_CLASS_NAME
191 value: "{{ .Values.kafka.authorizer }}"
194 value: "{{ .Values.kafka.jaasOptions }}"
195 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
196 value: "{{ .Values.kafka.protocolMap }}"
197 - name: KAFKA_LISTENERS
198 value: "{{ .Values.kafka.listeners }}"
199 - name: KAFKA_INTER_BROKER_LISTENER_NAME
200 value: "{{ .Values.kafka.interBrokerListerner }}"
202 {{- range $key, $value := .Values.configurationOverrides }}
203 - name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
204 value: {{ $value | quote }}
206 {{- if .Values.jmx.port }}
207 - name: KAFKA_JMX_PORT
208 value: "{{ .Values.jmx.port }}"
211 value: "{{ .Values.global.aafEnabled }}"
213 - mountPath: /etc/localtime
216 - mountPath: /var/run/docker.sock
218 {{- if .Values.global.aafEnabled }}
219 - mountPath: /etc/kafka/data/cadi.properties
220 subPath: cadi.properties
224 mountPath: /etc/kafka/secrets/jaas
225 - mountPath: /var/lib/kafka/data
227 {{- if .Values.tolerations }}
229 {{ toYaml .Values.tolerations | indent 10 }}
238 - name: docker-socket
240 path: /var/run/docker.sock
241 {{- if .Values.global.aafEnabled }}
244 name: {{ include "common.fullname" . }}-cadi-prop-configmap
248 name: {{ include "common.fullname" . }}-jaas-configmap
249 {{- if .Values.prometheus.jmx.enabled }}
252 name: {{ include "common.fullname" . }}-prometheus-configmap
254 {{ if not .Values.persistence.enabled }}
258 volumeClaimTemplates:
262 app: {{ include "common.fullname" . }}
263 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
264 release: "{{ include "common.release" . }}"
265 heritage: "{{ .Release.Service }}"
268 - {{ .Values.persistence.accessMode | quote }}
269 storageClassName: {{ include "common.storageClass" . }}
272 storage: {{ .Values.persistence.size | quote }}