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.
16 apiVersion: apps/v1beta1
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 }}
27 serviceName: {{ .Values.service.name }}
28 replicas: {{ .Values.replicaCount }}
32 maxUnavailable: {{ .Values.maxUnavailable }}
33 podManagementPolicy: Parallel
37 app: {{ include "common.name" . }}
38 release: {{ include "common.release" . }}
39 {{- if .Values.prometheus.jmx.enabled }}
41 prometheus.io/scrape: "true"
42 prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }}
46 preferredDuringSchedulingIgnoredDuringExecution:
54 - {{ include "common.name" . }}
58 - {{ include "common.release" . }}
59 topologyKey: "kubernetes.io/hostname"
60 {{- if .Values.nodeAffinity }}
62 {{ toYaml .Values.nodeAffinity | indent 10 }}
65 - name: {{ include "common.name" . }}-permission-fixer
70 chown -R 1000:0 /tmp/zookeeper/apikeys;
71 image: "{{ .Values.busyBoxRepository }}/{{ .Values.busyBoxImage }}"
72 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
74 - mountPath: /tmp/zookeeper/apikeys
80 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/etc/zookeeper/secrets/jaas/${PFILE}; done"
83 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "login") | indent 10 }}
85 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "zk-admin" "key" "password") | indent 10 }}
87 - mountPath: /etc/zookeeper/secrets/jaas
89 - mountPath: /config-input
91 image: "{{ .Values.global.envsubstImage }}"
92 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 name: {{ include "common.name" . }}-update-config
95 {{- if .Values.prometheus.jmx.enabled }}
96 - name: prometheus-jmx-exporter
97 image: "{{ .Values.prometheus.jmx.imageRepository }}/{{ .Values.prometheus.jmx.image }}:{{ .Values.prometheus.jmx.imageTag }}"
98 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
101 - -XX:+UnlockExperimentalVMOptions
102 - -XX:+UseCGroupMemoryLimitForHeap
103 - -XX:MaxRAMFraction=1
106 - jmx_prometheus_httpserver.jar
107 - {{ .Values.prometheus.jmx.port | quote }}
108 - /etc/jmx-zookeeper/jmx-zookeeper-prometheus.yml
110 - containerPort: {{ .Values.prometheus.jmx.port }}
112 {{ toYaml .Values.prometheus.jmx.resources | indent 10 }}
115 mountPath: /etc/jmx-zookeeper
117 - name: {{ include "common.name" . }}
118 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
119 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
121 {{ include "common.resources" . | indent 12 }}
123 - containerPort: {{ .Values.service.clientPort }}
124 name: {{ .Values.service.clientPortName }}
125 - containerPort: {{ .Values.service.serverPort }}
126 name: {{ .Values.service.serverPortName }}
127 - containerPort: {{ .Values.service.leaderElectionPort }}
128 name: {{ .Values.service.leaderElectionPortName }}
129 {{- if .Values.prometheus.jmx.enabled }}
130 - containerPort: {{ .Values.jmx.port }}
133 {{ if eq .Values.liveness.enabled true }}
136 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
137 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
138 periodSeconds: {{ .Values.liveness.periodSeconds }}
139 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
143 command: ['/bin/bash', '-c', 'echo "ruok" | nc -w 2 -q 2 localhost 2181 | grep imok']
144 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
145 periodSeconds: {{ .Values.readiness.periodSeconds }}
146 timeoutSeconds: {{ .Values.readiness.timeoutSeconds }}
148 {{ toYaml .Values.resources | indent 10 }}
150 - name : KAFKA_HEAP_OPTS
151 value: "{{ .Values.zkConfig.heapOptions }}"
152 {{- if .Values.jmx.port }}
153 - name : KAFKA_JMX_PORT
154 value: "{{ .Values.jmx.port }}"
156 - name : ZOOKEEPER_REPLICAS
157 value: "{{ .Values.replicaCount }}"
158 - name : ZOOKEEPER_TICK_TIME
159 value: "{{ .Values.zkConfig.tickTime }}"
160 - name : ZOOKEEPER_SYNC_LIMIT
161 value: "{{ .Values.zkConfig.syncLimit }}"
162 - name : ZOOKEEPER_INIT_LIMIT
163 value: "{{ .Values.zkConfig.initLimit }}"
164 - name : ZOOKEEPER_MAX_CLIENT_CNXNS
165 value: "{{ .Values.zkConfig.maxClientCnxns }}"
166 - name : ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
167 value: "{{ .Values.zkConfig.autoPurgeSnapRetainCount}}"
168 - name : ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
169 value: "{{ .Values.zkConfig.autoPurgePurgeInterval}}"
170 - name: ZOOKEEPER_CLIENT_PORT
171 value: "{{ .Values.zkConfig.clientPort }}"
173 value: "{{ .Values.zkConfig.kafkaOpts }}"
174 - name: ZOOKEEPER_SERVER_ID
177 fieldPath: metadata.name
182 ZOOKEEPER_SERVER_ID=$((${HOSTNAME##*-}+1)) \
183 /etc/confluent/docker/run
185 - mountPath: /etc/localtime
188 - mountPath: /var/lib/zookeeper/data
191 mountPath: /etc/zookeeper/secrets/jaas
192 {{- if .Values.tolerations }}
194 {{ toYaml .Values.tolerations | indent 10 }}
203 - name: docker-socket
205 path: /var/run/docker.sock
208 name: {{ include "common.fullname" . }}-jaas-configmap
209 {{- if .Values.prometheus.jmx.enabled }}
212 name: {{ include "common.fullname" . }}-prometheus-configmap
214 {{ if not .Values.persistence.enabled }}
215 - name: zookeeper-data
218 volumeClaimTemplates:
222 app: {{ include "common.fullname" . }}
223 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
224 release: "{{ include "common.release" . }}"
225 heritage: "{{ .Release.Service }}"
228 - {{ .Values.persistence.accessMode | quote }}
229 storageClassName: {{ include "common.storageClass" . }}
232 storage: {{ .Values.persistence.size | quote }}
235 - name: "{{ include "common.namespace" . }}-docker-registry-key"