1 # Copyright © 2017 Amdocs, Bell Canada
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.
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ include "common.release" . }}
25 heritage: {{ .Release.Service }}
29 app: {{ include "common.name" . }}
30 serviceName: {{ .Values.service.name }}
31 replicas: {{ .Values.replicaCount }}
35 maxUnavailable: {{ .Values.maxUnavailable }}
36 podManagementPolicy: Parallel
40 app: {{ include "common.name" . }}
41 release: {{ include "common.release" . }}
42 {{- if .Values.prometheus.jmx.enabled }}
44 prometheus.io/scrape: "true"
45 prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
48 {{- if .Values.nodeAffinity }}
50 {{ toYaml .Values.nodeAffinity | indent 10 }}
53 - name: "{{ include "common.namespace" . }}-docker-registry-key"
55 - name: {{ include "common.name" . }}-permission-fixer
60 chown -R 1000:0 /tmp/zookeeper/apikeys;
61 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
62 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64 - mountPath: /tmp/zookeeper/apikeys
70 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/zookeeper/secrets/jaas/${PFILE}; done"
73 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "login") | indent 10 }}
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "password") | indent 10 }}
77 - mountPath: /etc/zookeeper/secrets/jaas
79 - mountPath: /config-input
81 image: "{{ .Values.global.envsubstImage }}"
82 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83 name: {{ include "common.name" . }}-update-config
85 {{- if .Values.prometheus.jmx.enabled }}
86 - name: prometheus-jmx-exporter
87 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
88 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
91 - -XX:+UnlockExperimentalVMOptions
92 - -XX:+UseCGroupMemoryLimitForHeap
93 - -XX:MaxRAMFraction=1
96 - jmx_prometheus_httpserver.jar
97 - {{ .Values.prometheus.jmx.port | quote }}
98 - /etc/jmx-zookeeper/jmx-zookeeper-prometheus.yml
100 - containerPort: {{ .Values.prometheus.jmx.port }}
102 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
105 mountPath: /etc/jmx-zookeeper
107 - name: {{ include "common.name" . }}
108 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
109 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 {{ include "common.resources" . | indent 12 }}
113 - containerPort: {{ .Values.service.clientPort }}
114 name: {{ .Values.service.clientPortName }}
115 - containerPort: {{ .Values.service.serverPort }}
116 name: {{ .Values.service.serverPortName }}
117 - containerPort: {{ .Values.service.leaderElectionPort }}
118 name: {{ .Values.service.leaderElectionPortName }}
119 {{- if .Values.prometheus.jmx.enabled }}
120 - containerPort: {{ .Values.jmx.port }}
123 {{ if eq .Values.liveness.enabled true }}
126 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
127 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
128 periodSeconds: {{ .Values.liveness.periodSeconds }}
129 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
133 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
134 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
135 periodSeconds: {{ .Values.readiness.periodSeconds }}
136 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
138 {{ toYaml .Values.resources | indent 10 }}
140 - name : KAFKA_HEAP_OPTS
141 value: "{{ .Values.zkConfig.heapOptions }}"
142 {{- if .Values.jmx.port }}
143 - name : KAFKA_JMX_PORT
144 value: "{{ .Values.jmx.port }}"
146 - name : ZOOKEEPER_REPLICAS
147 value: "{{ .Values.replicaCount }}"
148 - name : ZOOKEEPER_TICK_TIME
149 value: "{{ .Values.zkConfig.tickTime }}"
150 - name : ZOOKEEPER_SYNC_LIMIT
151 value: "{{ .Values.zkConfig.syncLimit }}"
152 - name : ZOOKEEPER_INIT_LIMIT
153 value: "{{ .Values.zkConfig.initLimit }}"
154 - name : ZOOKEEPER_MAX_CLIENT_CNXNS
155 value: "{{ .Values.zkConfig.maxClientCnxns }}"
156 - name : ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
157 value: "{{ .Values.zkConfig.autoPurgeSnapRetainCount}}"
158 - name : ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
159 value: "{{ .Values.zkConfig.autoPurgePurgeInterval}}"
160 - name: ZOOKEEPER_CLIENT_PORT
161 value: "{{ .Values.zkConfig.clientPort }}"
163 value: "{{ .Values.zkConfig.kafkaOpts }}"
164 - name: ZOOKEEPER_SERVER_ID
167 fieldPath: metadata.name
172 ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) \
173 /etc/confluent/docker/run
175 - mountPath: /etc/localtime
178 - mountPath: /var/lib/zookeeper/data
181 mountPath: /etc/zookeeper/secrets/jaas
182 {{- if .Values.tolerations }}
184 {{ toYaml .Values.tolerations | indent 10 }}
193 - name: docker-socket
195 path: /var/run/docker.sock
198 name: {{ include "common.fullname" . }}-jaas-configmap
199 {{- if .Values.prometheus.jmx.enabled }}
202 name: {{ include "common.fullname" . }}-prometheus-configmap
204 {{ if not .Values.persistence.enabled }}
205 - name: zookeeper-data
208 volumeClaimTemplates:
212 app: {{ include "common.fullname" . }}
213 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
214 release: "{{ include "common.release" . }}"
215 heritage: "{{ .Release.Service }}"
218 - {{ .Values.persistence.accessMode | quote }}
219 storageClassName: {{ include "common.storageClass" . }}
222 storage: {{ .Values.persistence.size | quote }}