blob: 9e3549f20d4e989631da4bd590fb840ba45e9197 [file] [log] [blame]
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -04001apiVersion: apps/v1beta1
2kind: StatefulSet
3metadata:
4 name: {{ template "common.fullname" . }}
5 labels:
6 app: {{ template "common.name" . }}
7 chart: {{ .Chart.Name }}
8 release: {{ .Release.Name }}
9 heritage: {{ .Release.Service }}
10 component: server
11spec:
12 podAntiAffinity:
13 preferredDuringSchedulingIgnoredDuringExecution:
14 - weight: 1
15 podAffinityTerm:
16 labelSelector:
17 matchExpressions:
18 - key: app
19 operator: In
20 values:
21 - "{{ .Chart.Name }}"
22 serviceName: {{ template "common.fullname" . }}-headless
23 replicas: {{ .Values.replicaCount }}
24 terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
25 selector:
26 matchLabels:
27 app: {{ template "common.name" . }}
28 release: {{ .Release.Name }}
29 component: server
30 updateStrategy:
31{{ toYaml .Values.updateStrategy | indent 4 }}
32 template:
33 metadata:
34 labels:
35 app: {{ template "common.name" . }}
36 release: {{ .Release.Name }}
37 component: server
38 {{- if .Values.podLabels }}
39 ## Custom pod labels
40 {{- range $key, $value := .Values.podLabels }}
41 {{ $key }}: {{ $value | quote }}
42 {{- end }}
43 {{- end }}
44 annotations:
45 {{- if .Values.podAnnotations }}
46 ## Custom pod annotations
47 {{- range $key, $value := .Values.podAnnotations }}
48 {{ $key }}: {{ $value | quote }}
49 {{- end }}
50 {{- end }}
51 spec:
52{{- if .Values.schedulerName }}
53 schedulerName: "{{ .Values.schedulerName }}"
54{{- end }}
55 securityContext:
56{{ toYaml .Values.securityContext | indent 8 }}
57 containers:
58
59 - name: zookeeper
60 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +000061 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040062 command:
63 - /bin/bash
64 - -xec
65 - zkGenConfig.sh && exec zkServer.sh start-foreground
66 ports:
67{{- range $key, $port := .Values.ports }}
68 - name: {{ $key }}
69{{ toYaml $port | indent 14 }}
70{{- end }}
71 livenessProbe:
72{{ toYaml .Values.livenessProbe | indent 12 }}
73 readinessProbe:
74{{ toYaml .Values.readinessProbe | indent 12 }}
75 env:
76 - name: ZK_REPLICAS
77 value: {{ .Values.replicaCount | quote }}
78 {{- range $key, $value := .Values.env }}
79 - name: {{ $key | upper | replace "." "_" }}
80 value: {{ $value | quote }}
81 {{- end }}
82 resources:
83{{ include "common.resources" . }}
84 volumeMounts:
85 - name: zookeeper-data
86 mountPath: /var/lib/zookeeper
87
88{{- if .Values.exporters.jmx.enabled }}
89 - name: jmx-exporter
90 image: "{{ .Values.exporters.jmx.image.repository }}:{{ .Values.exporters.jmx.image.tag }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +000091 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.exporters.jmx.image.pullPolicy }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -040092 ports:
93 {{- range $key, $port := .Values.exporters.jmx.ports }}
94 - name: {{ $key }}
95{{ toYaml $port | indent 14 }}
96 {{- end }}
97 livenessProbe:
98{{ toYaml .Values.exporters.jmx.livenessProbe | indent 12 }}
99 readinessProbe:
100{{ toYaml .Values.exporters.jmx.readinessProbe | indent 12 }}
101 env:
102 - name: SERVICE_PORT
103 value: {{ .Values.exporters.jmx.ports.jmxxp.containerPort | quote }}
104 {{- with .Values.exporters.jmx.env }}
105 {{- range $key, $value := . }}
106 - name: {{ $key | upper | replace "." "_" }}
107 value: {{ $value | quote }}
108 {{- end }}
109 {{- end }}
110 resources:
111{{ toYaml .Values.exporters.jmx.resources | indent 12 }}
112 volumeMounts:
113 - name: config-jmx-exporter
114 mountPath: /opt/jmx_exporter/config.yml
115 subPath: config.yml
116{{- end }}
117
118{{- if .Values.exporters.zookeeper.enabled }}
119 - name: zookeeper-exporter
120 image: "{{ .Values.exporters.zookeeper.image.repository }}:{{ .Values.exporters.zookeeper.image.tag }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +0000121 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.exporters.zookeeper.image.pullPolicy }}
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -0400122 args:
123 - -bind-addr=:{{ .Values.exporters.zookeeper.ports.zookeeperxp.containerPort }}
124 - -metrics-path={{ .Values.exporters.zookeeper.path }}
125 - -zookeeper=localhost:{{ .Values.ports.client.containerPort }}
126 - -log-level={{ .Values.exporters.zookeeper.config.logLevel }}
127 - -reset-on-scrape={{ .Values.exporters.zookeeper.config.resetOnScrape }}
128 ports:
129 {{- range $key, $port := .Values.exporters.zookeeper.ports }}
130 - name: {{ $key }}
131{{ toYaml $port | indent 14 }}
132 {{- end }}
133 livenessProbe:
134{{ toYaml .Values.exporters.zookeeper.livenessProbe | indent 12 }}
135 readinessProbe:
136{{ toYaml .Values.exporters.zookeeper.readinessProbe | indent 12 }}
137 env:
138 {{- range $key, $value := .Values.exporters.zookeeper.env }}
139 - name: {{ $key | upper | replace "." "_" }}
140 value: {{ $value | quote }}
141 {{- end }}
142 resources:
143{{ toYaml .Values.exporters.zookeeper.resources | indent 12 }}
144{{- end }}
145
146 {{- with .Values.nodeSelector }}
147 nodeSelector:
148{{ toYaml . | indent 8 }}
149 {{- end }}
150 {{- with .Values.affinity }}
151 affinity:
152{{ toYaml . | indent 8 }}
153 {{- end }}
154 {{- with .Values.tolerations }}
155 tolerations:
156{{ toYaml . | indent 8 }}
157 {{- end }}
158 {{- if (or .Values.exporters.jmx.enabled (not .Values.persistence.enabled)) }}
159 volumes:
160 {{- if .Values.exporters.jmx.enabled }}
161 - name: config-jmx-exporter
162 configMap:
163 name: {{ .Release.Name }}-jmx-exporter
164 {{- end }}
165 {{- if not .Values.persistence.enabled }}
166 - name: zookeeper-data
167 emptyDir: {}
168 {{- end }}
169 {{- end }}
170 {{- if .Values.persistence.enabled }}
171 volumeClaimTemplates:
172 - metadata:
173 name: zookeeper-data
174 labels:
175 app: {{ .Chart.Name }}
176 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
177 release: "{{ .Release.Name }}"
178 heritage: "{{ .Release.Service }}"
179 annotations:
180 volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass }}
181 spec:
182 storageClassName: {{ .Values.persistence.storageClass }}
183 accessModes:
184 - {{ .Values.persistence.accessMode | quote }}
185 resources:
186 requests:
187 storage: {{ .Values.persistence.size | quote }}
Alexis de Talhouƫt634b4552018-10-28 21:56:33 -0400188 selector:
189 matchLabels:
190 release: "{{ .Release.Name }}"
Nelson,Thomas(tn1381)(arthurdent3)4807fdf2018-09-19 16:52:36 -0400191 {{- end }}