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.
15 apiVersion: apps/v1beta1
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 }}
26 serviceName: {{ .Values.service.name }}
27 replicas: {{ .Values.replicaCount }}
28 podManagementPolicy: Parallel
32 app: {{ include "common.name" . }}
33 release: {{ include "common.release" . }}
34 {{- if .Values.prometheus.jmx.enabled }}
36 prometheus.io/scrape: "true"
37 prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
41 {{if eq .Values.podAntiAffinityType "hard" -}}
42 requiredDuringSchedulingIgnoredDuringExecution:
44 preferredDuringSchedulingIgnoredDuringExecution:
53 - {{ include "common.name" . }}
57 - {{ include "common.release" . }}
58 topologyKey: "kubernetes.io/hostname"
59 {{- if .Values.nodeAffinity }}
61 {{ toYaml .Values.nodeAffinity | indent 10 }}
64 - name: {{ include "common.name" . }}-initcontainer
65 image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
66 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71 - {{ .Values.zookeeper.name }}
77 fieldPath: metadata.namespace
78 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
79 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 name: {{ include "common.name" . }}-readiness
85 rm -rf '/var/lib/kafka/data/lost+found';
86 chown -R 1000:0 /var/lib/kafka/data;
87 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
88 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
90 - mountPath: /var/lib/kafka/data
92 name: {{ include "common.name" . }}-permission-fixer
97 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/kafka/secrets/jaas/${PFILE}; done"
100 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-client" "key" "login") | indent 10 }}
102 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-client" "key" "password") | indent 10 }}
104 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "kafka-admin" "key" "login") | indent 10 }}
106 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "kafka-admin" "key" "password") | indent 10 }}
108 - mountPath: /etc/kafka/secrets/jaas
110 - mountPath: /config-input
112 image: "{{ .Values.global.envsubstImage }}"
113 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
114 name: {{ include "common.name" . }}-update-config
116 {{- if .Values.prometheus.jmx.enabled }}
117 - name: prometheus-jmx-exporter
118 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
119 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
122 - -XX:+UnlockExperimentalVMOptions
123 - -XX:+UseCGroupMemoryLimitForHeap
124 - -XX:MaxRAMFraction=1
127 - jmx_prometheus_httpserver.jar
128 - {{ .Values.prometheus.jmx.port | quote }}
129 - /etc/jmx-kafka/jmx-kafka-prometheus.yml
131 - containerPort: {{ .Values.prometheus.jmx.port }}
133 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
136 mountPath: /etc/jmx-kafka
138 - name: {{ include "common.name" . }}
139 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
140 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
145 export KAFKA_BROKER_ID=${HOSTNAME##*-} && \
146 {{- if .Values.global.aafEnabled }}
147 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_SASL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_SASL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
149 export KAFKA_ADVERTISED_LISTENERS=EXTERNAL_PLAINTEXT://$(HOST_IP):$(( $KAFKA_BROKER_ID + {{ .Values.service.baseNodePort }} )),INTERNAL_PLAINTEXT://:{{ .Values.service.internalPort }} && \
151 exec /etc/confluent/docker/run
153 {{ include "common.resources" . | indent 12 }}
155 - containerPort: {{ .Values.service.internalPort }}
156 - containerPort: {{ .Values.service.externalPort }}
157 {{- if .Values.prometheus.jmx.enabled }}
158 - containerPort: {{ .Values.jmx.port }}
161 {{ if eq .Values.liveness.enabled true }}
164 port: {{ .Values.service.internalPort }}
165 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
166 periodSeconds: {{ .Values.liveness.periodSeconds }}
167 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
171 port: {{ .Values.service.internalPort }}
172 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
173 periodSeconds: {{ .Values.readiness.periodSeconds }}
174 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
180 fieldPath: status.hostIP
181 - name: KAFKA_ZOOKEEPER_CONNECT
182 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}}
183 - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
184 value: "{{ .Values.kafka.enableSupport }}"
186 value: "{{ .Values.kafka.jaasOptions }}"
187 {{- if .Values.global.aafEnabled }}
189 value: "{{ .Values.kafka.jaasOptionsAaf }}"
190 - name: aaf_locate_url
191 value: https://aaf-locate.{{ include "common.namespace" . }}:8095
192 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
193 value: "{{ .Values.kafka.protocolMapAaf }}"
194 - name: KAFKA_LISTENERS
195 value: "{{ .Values.kafka.listenersAaf }}"
196 - name: KAFKA_SASL_ENABLED_MECHANISMS
197 value: "{{ .Values.kafka.saslMech }}"
198 - name: KAFKA_INTER_BROKER_LISTENER_NAME
199 value: "{{ .Values.kafka.interBrokerListernerAaf }}"
200 - name: KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL
201 value: "{{ .Values.kafka.saslInterBrokerProtocol }}"
202 - name: KAFKA_AUTHORIZER_CLASS_NAME
203 value: "{{ .Values.kafka.authorizer }}"
206 value: "{{ .Values.kafka.jaasOptions }}"
207 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
208 value: "{{ .Values.kafka.protocolMap }}"
209 - name: KAFKA_LISTENERS
210 value: "{{ .Values.kafka.listeners }}"
211 - name: KAFKA_INTER_BROKER_LISTENER_NAME
212 value: "{{ .Values.kafka.interBrokerListerner }}"
214 {{- range $key, $value := .Values.configurationOverrides }}
215 - name: {{ printf "KAFKA_%s" $key | replace "." "_" | upper | quote }}
216 value: {{ $value | quote }}
218 {{- if .Values.jmx.port }}
219 - name: KAFKA_JMX_PORT
220 value: "{{ .Values.jmx.port }}"
223 value: "{{ .Values.global.aafEnabled }}"
225 - mountPath: /etc/localtime
228 - mountPath: /var/run/docker.sock
230 {{- if .Values.global.aafEnabled }}
231 - mountPath: /etc/kafka/data/cadi.properties
232 subPath: cadi.properties
236 mountPath: /etc/kafka/secrets/jaas
237 - mountPath: /var/lib/kafka/data
239 {{- if .Values.tolerations }}
241 {{ toYaml .Values.tolerations | indent 10 }}
250 - name: docker-socket
252 path: /var/run/docker.sock
253 {{- if .Values.global.aafEnabled }}
256 name: {{ include "common.fullname" . }}-cadi-prop-configmap
260 name: {{ include "common.fullname" . }}-jaas-configmap
261 {{- if .Values.prometheus.jmx.enabled }}
264 name: {{ include "common.fullname" . }}-prometheus-configmap
266 {{ if not .Values.persistence.enabled }}
270 volumeClaimTemplates:
274 app: {{ include "common.fullname" . }}
275 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
276 release: "{{ include "common.release" . }}"
277 heritage: "{{ .Release.Service }}"
280 - {{ .Values.persistence.accessMode | quote }}
281 storageClassName: {{ include "common.storageClass" . }}
284 storage: {{ .Values.persistence.size | quote }}
287 - name: "{{ include "common.namespace" . }}-docker-registry-key"