1 # Modifications Copyright © 2018 AT&T
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ include "common.release" . }}
24 heritage: {{ .Release.Service }}
28 app: {{ include "common.name" . }}
29 serviceName: {{ .Values.service.name }}
30 replicas: {{ .Values.replicaCount }}
31 podManagementPolicy: Parallel
35 app: {{ include "common.name" . }}
36 release: {{ include "common.release" . }}
37 {{- if .Values.prometheus.jmx.enabled }}
39 prometheus.io/scrape: "true"
40 prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
43 {{- if .Values.nodeAffinity }}
45 {{ toYaml .Values.nodeAffinity | indent 10 }}
48 - name: "{{ include "common.namespace" . }}-docker-registry-key"
50 - name: {{ include "common.name" . }}-initcontainer
51 image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 - {{ .Values.zookeeper.name }}
63 fieldPath: metadata.namespace
64 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
65 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 name: {{ include "common.name" . }}-readiness
71 rm -rf '/var/lib/kafka/data/lost+found';
72 chown -R 1000:0 /var/lib/kafka/data;
73 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
74 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
76 - mountPath: /var/lib/kafka/data
78 name: {{ include "common.name" . }}-permission-fixer
83 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/kafka/secrets/jaas/${PFILE}; done"
86 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-client" "key" "login") | indent 10 }}
88 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-client" "key" "password") | indent 10 }}
90 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "kafka-admin" "key" "login") | indent 10 }}
92 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "kafka-admin" "key" "password") | indent 10 }}
94 - mountPath: /etc/kafka/secrets/jaas
96 - mountPath: /config-input
98 image: "{{ .Values.global.envsubstImage }}"
99 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
100 name: {{ include "common.name" . }}-update-config
102 {{- if .Values.prometheus.jmx.enabled }}
103 - name: prometheus-jmx-exporter
104 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
105 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
108 - -XX:+UnlockExperimentalVMOptions
109 - -XX:+UseCGroupMemoryLimitForHeap
110 - -XX:MaxRAMFraction=1
113 - jmx_prometheus_httpserver.jar
114 - {{ .Values.prometheus.jmx.port | quote }}
115 - /etc/jmx-kafka/jmx-kafka-prometheus.yml
117 - containerPort: {{ .Values.prometheus.jmx.port }}
119 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
122 mountPath: /etc/jmx-kafka
124 - name: {{ include "common.name" . }}
125 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
126 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
131 export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
132 {{- if .Values.global.aafEnabled }}
133 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_SASL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_SASL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
135 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
137 exec /etc/confluent/docker/run
139 {{ include "common.resources" . | indent 12 }}
141 - containerPort: {{ .Values.service.internalPort }}
142 - containerPort: {{ .Values.service.externalPort }}
143 {{- if .Values.prometheus.jmx.enabled }}
144 - containerPort: {{ .Values.jmx.port }}
147 {{ if eq .Values.liveness.enabled true }}
150 port: {{ .Values.service.internalPort }}
151 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
152 periodSeconds: {{ .Values.liveness.periodSeconds }}
153 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
157 port: {{ .Values.service.internalPort }}
158 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
159 periodSeconds: {{ .Values.readiness.periodSeconds }}
160 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
166 fieldPath: status.hostIP
167 - name: KAFKA_ZOOKEEPER_CONNECT
168 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}}
169 - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
170 value: "{{ .Values.kafka.enableSupport }}"
172 value: "{{ .Values.kafka.jaasOptions }}"
173 {{- if .Values.global.aafEnabled }}
175 value: "{{ .Values.kafka.jaasOptionsAaf }}"
176 - name: aaf_locate_url
177 value: https://aaf-locate.{{ include "common.namespace" . }}:8095
178 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
179 value: "{{ .Values.kafka.protocolMapAaf }}"
180 - name: KAFKA_LISTENERS
181 value: "{{ .Values.kafka.listenersAaf }}"
182 - name: KAFKA_SASL_ENABLED_MECHANISMS
183 value: "{{ .Values.kafka.saslMech }}"
184 - name: KAFKA_INTER_BROKER_LISTENER_NAME
185 value: "{{ .Values.kafka.interBrokerListernerAaf }}"
186 - name: KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL
187 value: "{{ .Values.kafka.saslInterBrokerProtocol }}"
188 - name: KAFKA_AUTHORIZER_CLASS_NAME
189 value: "{{ .Values.kafka.authorizer }}"
192 value: "{{ .Values.kafka.jaasOptions }}"
193 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
194 value: "{{ .Values.kafka.protocolMap }}"
195 - name: KAFKA_LISTENERS
196 value: "{{ .Values.kafka.listeners }}"
197 - name: KAFKA_INTER_BROKER_LISTENER_NAME
198 value: "{{ .Values.kafka.interBrokerListerner }}"
200 {{- range $key, $value := .Values.configurationOverrides }}
201 - name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
202 value: {{ $value | quote }}
204 {{- if .Values.jmx.port }}
205 - name: KAFKA_JMX_PORT
206 value: "{{ .Values.jmx.port }}"
209 value: "{{ .Values.global.aafEnabled }}"
211 - mountPath: /etc/localtime
214 - mountPath: /var/run/docker.sock
216 {{- if .Values.global.aafEnabled }}
217 - mountPath: /etc/kafka/data/cadi.properties
218 subPath: cadi.properties
222 mountPath: /etc/kafka/secrets/jaas
223 - mountPath: /var/lib/kafka/data
225 {{- if .Values.tolerations }}
227 {{ toYaml .Values.tolerations | indent 10 }}
236 - name: docker-socket
238 path: /var/run/docker.sock
239 {{- if .Values.global.aafEnabled }}
242 name: {{ include "common.fullname" . }}-cadi-prop-configmap
246 name: {{ include "common.fullname" . }}-jaas-configmap
247 {{- if .Values.prometheus.jmx.enabled }}
250 name: {{ include "common.fullname" . }}-prometheus-configmap
252 {{ if not .Values.persistence.enabled }}
256 volumeClaimTemplates:
260 app: {{ include "common.fullname" . }}
261 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
262 release: "{{ include "common.release" . }}"
263 heritage: "{{ .Release.Service }}"
266 - {{ .Values.persistence.accessMode | quote }}
267 storageClassName: {{ include "common.storageClass" . }}
270 storage: {{ .Values.persistence.size | quote }}