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 }}
49 preferredDuringSchedulingIgnoredDuringExecution:
57 - {{ include "common.name" . }}
61 - {{ include "common.release" . }}
62 topologyKey: "kubernetes.io/hostname"
63 {{- if .Values.nodeAffinity }}
65 {{ toYaml .Values.nodeAffinity | indent 10 }}
68 - name: {{ include "common.name" . }}-permission-fixer
73 chown -R 1000:0 /tmp/zookeeper/apikeys;
74 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
75 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77 - mountPath: /tmp/zookeeper/apikeys
83 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/zookeeper/secrets/jaas/${PFILE}; done"
86 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "login") | indent 10 }}
88 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "password") | indent 10 }}
90 - mountPath: /etc/zookeeper/secrets/jaas
92 - mountPath: /config-input
94 image: "{{ .Values.global.envsubstImage }}"
95 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
96 name: {{ include "common.name" . }}-update-config
98 {{- if .Values.prometheus.jmx.enabled }}
99 - name: prometheus-jmx-exporter
100 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
101 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
104 - -XX:+UnlockExperimentalVMOptions
105 - -XX:+UseCGroupMemoryLimitForHeap
106 - -XX:MaxRAMFraction=1
109 - jmx_prometheus_httpserver.jar
110 - {{ .Values.prometheus.jmx.port | quote }}
111 - /etc/jmx-zookeeper/jmx-zookeeper-prometheus.yml
113 - containerPort: {{ .Values.prometheus.jmx.port }}
115 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
118 mountPath: /etc/jmx-zookeeper
120 - name: {{ include "common.name" . }}
121 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
122 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
124 {{ include "common.resources" . | indent 12 }}
126 - containerPort: {{ .Values.service.clientPort }}
127 name: {{ .Values.service.clientPortName }}
128 - containerPort: {{ .Values.service.serverPort }}
129 name: {{ .Values.service.serverPortName }}
130 - containerPort: {{ .Values.service.leaderElectionPort }}
131 name: {{ .Values.service.leaderElectionPortName }}
132 {{- if .Values.prometheus.jmx.enabled }}
133 - containerPort: {{ .Values.jmx.port }}
136 {{ if eq .Values.liveness.enabled true }}
139 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
140 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
141 periodSeconds: {{ .Values.liveness.periodSeconds }}
142 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
146 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
147 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
148 periodSeconds: {{ .Values.readiness.periodSeconds }}
149 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
151 {{ toYaml .Values.resources | indent 10 }}
153 - name : KAFKA_HEAP_OPTS
154 value: "{{ .Values.zkConfig.heapOptions }}"
155 {{- if .Values.jmx.port }}
156 - name : KAFKA_JMX_PORT
157 value: "{{ .Values.jmx.port }}"
159 - name : ZOOKEEPER_REPLICAS
160 value: "{{ .Values.replicaCount }}"
161 - name : ZOOKEEPER_TICK_TIME
162 value: "{{ .Values.zkConfig.tickTime }}"
163 - name : ZOOKEEPER_SYNC_LIMIT
164 value: "{{ .Values.zkConfig.syncLimit }}"
165 - name : ZOOKEEPER_INIT_LIMIT
166 value: "{{ .Values.zkConfig.initLimit }}"
167 - name : ZOOKEEPER_MAX_CLIENT_CNXNS
168 value: "{{ .Values.zkConfig.maxClientCnxns }}"
169 - name : ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
170 value: "{{ .Values.zkConfig.autoPurgeSnapRetainCount}}"
171 - name : ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
172 value: "{{ .Values.zkConfig.autoPurgePurgeInterval}}"
173 - name: ZOOKEEPER_CLIENT_PORT
174 value: "{{ .Values.zkConfig.clientPort }}"
176 value: "{{ .Values.zkConfig.kafkaOpts }}"
177 - name: ZOOKEEPER_SERVER_ID
180 fieldPath: metadata.name
185 ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) \
186 /etc/confluent/docker/run
188 - mountPath: /etc/localtime
191 - mountPath: /var/lib/zookeeper/data
194 mountPath: /etc/zookeeper/secrets/jaas
195 {{- if .Values.tolerations }}
197 {{ toYaml .Values.tolerations | indent 10 }}
206 - name: docker-socket
208 path: /var/run/docker.sock
211 name: {{ include "common.fullname" . }}-jaas-configmap
212 {{- if .Values.prometheus.jmx.enabled }}
215 name: {{ include "common.fullname" . }}-prometheus-configmap
217 {{ if not .Values.persistence.enabled }}
218 - name: zookeeper-data
221 volumeClaimTemplates:
225 app: {{ include "common.fullname" . }}
226 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
227 release: "{{ include "common.release" . }}"
228 heritage: "{{ .Release.Service }}"
231 - {{ .Values.persistence.accessMode | quote }}
232 storageClassName: {{ include "common.storageClass" . }}
235 storage: {{ .Values.persistence.size | quote }}
238 - name: "{{ include "common.namespace" . }}-docker-registry-key"