2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications Copyright © 2018 AT&T
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 name: {{ include "common.fullname" . }}
22 namespace: {{ include "common.namespace" . }}
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26 release: {{ include "common.release" . }}
27 heritage: {{ .Release.Service }}
31 app: {{ include "common.name" . }}
32 serviceName: {{ .Values.service.name }}
33 replicas: {{ .Values.replicaCount }}
37 maxUnavailable: {{ .Values.maxUnavailable }}
38 podManagementPolicy: Parallel
42 app: {{ include "common.name" . }}
43 release: {{ include "common.release" . }}
44 {{- if .Values.prometheus.jmx.enabled }}
46 prometheus.io/scrape: "true"
47 prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
50 {{- if .Values.nodeAffinity }}
52 {{ toYaml .Values.nodeAffinity | indent 10 }}
55 - name: "{{ include "common.namespace" . }}-docker-registry-key"
57 - name: {{ include "common.name" . }}-permission-fixer
62 chown -R 1000:0 /tmp/zookeeper/apikeys;
63 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
64 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 - mountPath: /tmp/zookeeper/apikeys
72 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/zookeeper/secrets/jaas/${PFILE}; done"
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "login") | indent 10 }}
77 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "password") | indent 10 }}
79 - mountPath: /etc/zookeeper/secrets/jaas
81 - mountPath: /config-input
83 image: "{{ .Values.global.envsubstImage }}"
84 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 name: {{ include "common.name" . }}-update-config
87 {{- if .Values.prometheus.jmx.enabled }}
88 - name: prometheus-jmx-exporter
89 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
90 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 - -XX:+UnlockExperimentalVMOptions
94 - -XX:+UseCGroupMemoryLimitForHeap
95 - -XX:MaxRAMFraction=1
98 - jmx_prometheus_httpserver.jar
99 - {{ .Values.prometheus.jmx.port | quote }}
100 - /etc/jmx-zookeeper/jmx-zookeeper-prometheus.yml
102 - containerPort: {{ .Values.prometheus.jmx.port }}
104 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
107 mountPath: /etc/jmx-zookeeper
109 - name: {{ include "common.name" . }}
110 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
111 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
113 {{ include "common.resources" . | indent 12 }}
115 - containerPort: {{ .Values.service.clientPort }}
116 name: {{ .Values.service.clientPortName }}
117 - containerPort: {{ .Values.service.serverPort }}
118 name: {{ .Values.service.serverPortName }}
119 - containerPort: {{ .Values.service.leaderElectionPort }}
120 name: {{ .Values.service.leaderElectionPortName }}
121 {{- if .Values.prometheus.jmx.enabled }}
122 - containerPort: {{ .Values.jmx.port }}
125 {{ if eq .Values.liveness.enabled true }}
128 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
129 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
130 periodSeconds: {{ .Values.liveness.periodSeconds }}
131 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
135 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
136 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
137 periodSeconds: {{ .Values.readiness.periodSeconds }}
138 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
140 {{ include "common.resources" . | indent 10 }}
142 - name : KAFKA_HEAP_OPTS
143 value: "{{ .Values.zkConfig.heapOptions }}"
144 {{- if .Values.jmx.port }}
145 - name : KAFKA_JMX_PORT
146 value: "{{ .Values.jmx.port }}"
148 - name : ZOOKEEPER_REPLICAS
149 value: "{{ .Values.replicaCount }}"
150 - name : ZOOKEEPER_TICK_TIME
151 value: "{{ .Values.zkConfig.tickTime }}"
152 - name : ZOOKEEPER_SYNC_LIMIT
153 value: "{{ .Values.zkConfig.syncLimit }}"
154 - name : ZOOKEEPER_INIT_LIMIT
155 value: "{{ .Values.zkConfig.initLimit }}"
156 - name : ZOOKEEPER_MAX_CLIENT_CNXNS
157 value: "{{ .Values.zkConfig.maxClientCnxns }}"
158 - name : ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
159 value: "{{ .Values.zkConfig.autoPurgeSnapRetainCount}}"
160 - name : ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
161 value: "{{ .Values.zkConfig.autoPurgePurgeInterval}}"
162 - name: ZOOKEEPER_CLIENT_PORT
163 value: "{{ .Values.zkConfig.clientPort }}"
165 value: "{{ .Values.zkConfig.kafkaOpts }}"
166 - name: ZOOKEEPER_SERVER_ID
169 fieldPath: metadata.name
174 ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) \
175 /etc/confluent/docker/run
177 - mountPath: /etc/localtime
180 - mountPath: /var/lib/zookeeper/data
183 mountPath: /etc/zookeeper/secrets/jaas
184 {{- if .Values.tolerations }}
186 {{ toYaml .Values.tolerations | indent 10 }}
195 - name: docker-socket
197 path: /var/run/docker.sock
200 name: {{ include "common.fullname" . }}-jaas-configmap
201 {{- if .Values.prometheus.jmx.enabled }}
204 name: {{ include "common.fullname" . }}-prometheus-configmap
206 {{ if not .Values.persistence.enabled }}
207 - name: zookeeper-data
210 volumeClaimTemplates:
214 app: {{ include "common.fullname" . }}
215 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
216 release: "{{ include "common.release" . }}"
217 heritage: "{{ .Release.Service }}"
220 - {{ .Values.persistence.accessMode | quote }}
221 storageClassName: {{ include "common.storageClass" . }}
224 storage: {{ .Values.persistence.size | quote }}