-
Notifications
You must be signed in to change notification settings - Fork 351
/
Copy pathquery-deploy.yaml
319 lines (319 loc) · 11.4 KB
/
query-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
{{- if .Values.query.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "jaeger.query.name" . }}
labels:
{{- include "jaeger.labels" . | nindent 4 }}
app.kubernetes.io/component: query
{{- if .Values.query.annotations }}
annotations:
{{- toYaml .Values.query.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.query.replicaCount }}
selector:
matchLabels:
{{- include "jaeger.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: query
template:
metadata:
{{- if or .Values.query.config .Values.query.podAnnotations }}
annotations:
{{- if .Values.query.config }}
checksum/ui-config: {{ include (print $.Template.BasePath "/query-configmap.yaml") . | sha256sum }}
{{- end }}
{{- if and .Values.query.oAuthSidecar.enabled .Values.query.oAuthSidecar.config }}
checksum/oauth2-config: {{ sha256sum .Values.query.oAuthSidecar.config }}
{{- end }}
{{- if .Values.query.podAnnotations }}
{{- toYaml .Values.query.podAnnotations | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "jaeger.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: query
{{- if .Values.query.podLabels }}
{{- toYaml .Values.query.podLabels | nindent 8 }}
{{- end }}
spec:
{{- with .Values.query.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
securityContext:
{{- toYaml .Values.query.podSecurityContext | nindent 8 }}
serviceAccountName: {{ template "jaeger.query.serviceAccountName" . }}
{{- include "query.imagePullSecrets" . | nindent 6 }}
{{- if or .Values.query.initContainers .Values.provisionDataStore.elasticsearch }}
initContainers:
{{- if .Values.query.initContainers }}
{{- toYaml .Values.query.initContainers | nindent 8 }}
{{- end }}
{{- if .Values.provisionDataStore.elasticsearch }}
- name: elasticsearch-checker
image: {{ include "curl.image" . }}
command:
- sh
- "-c"
- |
url="{{ include "elasticsearch.client.url" . }}"
until [ "$(curl -s -o /dev/null -w '%{http_code}' "$url/_cluster/health")" = "200" ]; do
echo "waiting for Elasticsearch at $url"
sleep 5
done
{{- end }}
{{- end }}
containers:
- name: {{ template "jaeger.query.name" . }}
securityContext:
{{- toYaml .Values.query.securityContext | nindent 10 }}
image: {{ include "query.image" . }}
imagePullPolicy: {{ .Values.query.image.pullPolicy }}
args:
{{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.query.cmdlineParams ) | nindent 10 }}
{{- include "storage.cmdArgs" . | nindent 10 }}
env:
{{- if .Values.query.extraEnv }}
{{- toYaml .Values.query.extraEnv | nindent 10 }}
{{- end }}
- name: SPAN_STORAGE_TYPE
value: {{ .Values.storage.type }}
{{- include "storage.env" . | nindent 10 }}
{{- if .Values.query.basePath }}
- name: QUERY_BASE_PATH
value: {{ .Values.query.basePath | quote }}
{{- end }}
- name: JAEGER_AGENT_PORT
value: "6831"
{{- if .Values.query.config}}
- name: QUERY_UI_CONFIG
value: /etc/conf/query-ui-config.json
{{- end }}
{{- with .Values.query.envFrom }}
envFrom: {{- toYaml . | nindent 10 }}
{{- end }}
ports:
- name: query
containerPort: 16686
protocol: TCP
- name: grpc
containerPort: 16685
protocol: TCP
- name: admin
containerPort: 16687
protocol: TCP
resources:
{{- toYaml .Values.query.resources | nindent 10 }}
volumeMounts:
{{- range .Values.query.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.query.extraConfigmapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- if .Values.storage.cassandra.tls.enabled }}
- name: {{ .Values.storage.cassandra.tls.secretName }}
mountPath: "/cassandra-tls/ca-cert.pem"
subPath: "ca-cert.pem"
readOnly: true
- name: {{ .Values.storage.cassandra.tls.secretName }}
mountPath: "/cassandra-tls/client-cert.pem"
subPath: "client-cert.pem"
readOnly: true
- name: {{ .Values.storage.cassandra.tls.secretName }}
mountPath: "/cassandra-tls/client-key.pem"
subPath: "client-key.pem"
readOnly: true
{{- end }}
{{- if .Values.storage.elasticsearch.tls.enabled }}
- name: {{ .Values.storage.elasticsearch.tls.secretName }}
mountPath: {{ .Values.storage.elasticsearch.tls.mountPath }}
subPath: {{ .Values.storage.elasticsearch.tls.subPath }}
readOnly: true
{{- end }}
{{- if .Values.query.config}}
- name: ui-configuration
mountPath: /etc/conf/
{{- end }}
livenessProbe:
httpGet:
path: /
port: admin
readinessProbe:
httpGet:
path: /
port: admin
{{- if .Values.query.oAuthSidecar.enabled }}
- name: {{ template "jaeger.agent.name" . }}-oauth2-sidecar
securityContext:
{{- toYaml .Values.query.securityContext | nindent 10 }}
image: {{ include "oAuthSidecar.image" . }}
imagePullPolicy: {{ .Values.query.oAuthSidecar.image.pullPolicy }}
args:
{{- range .Values.query.oAuthSidecar.args }}
- {{ . }}
{{- end }}
{{- if .Values.query.oAuthSidecar.extraEnv }}
env:
{{- toYaml .Values.query.oAuthSidecar.extraEnv | nindent 10 }}
{{- end }}
volumeMounts:
{{- range .Values.query.oAuthSidecar.extraConfigmapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.query.oAuthSidecar.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- if .Values.query.oAuthSidecar.config}}
- name: jaeger-oauth-configuration
mountPath: /etc/oauth2-proxy
{{- end }}
ports:
- containerPort: {{ .Values.query.oAuthSidecar.containerPort }}
name: oauth-proxy
resources:
{{- toYaml .Values.query.oAuthSidecar.resources | nindent 10 }}
{{- if .Values.query.oAuthSidecar.livenessProbe }}
livenessProbe:
{{- toYaml .Values.query.oAuthSidecar.livenessProbe | nindent 10 }}
{{- end }}
{{- if .Values.query.oAuthSidecar.readinessProbe }}
readinessProbe:
{{- toYaml .Values.query.oAuthSidecar.readinessProbe | nindent 10 }}
{{- end }}
{{- end }}
{{- if .Values.query.agentSidecar.enabled }}
- name: {{ template "jaeger.agent.name" . }}-sidecar
securityContext:
{{- toYaml .Values.query.securityContext | nindent 10 }}
image: {{ include "agent.image" . }}
imagePullPolicy: {{ .Values.agent.image.pullPolicy }}
args:
{{- range $key, $value := .Values.agent.cmdlineParams }}
{{- if $value }}
- --{{ $key }}={{ $value }}
{{- else }}
- --{{ $key }}
{{- end }}
{{- end }}
env:
{{- if not (hasKey .Values.agent.cmdlineParams "reporter.grpc.host-port") }}
- name: REPORTER_GRPC_HOST_PORT
value: {{ include "jaeger.collector.name" . }}:{{ .Values.collector.service.grpc.port }}
{{- end }}
ports:
- name: admin
containerPort: 14271
protocol: TCP
resources:
{{- toYaml .Values.query.agentSidecar.resources | nindent 10 }}
volumeMounts:
{{- range .Values.agent.extraConfigmapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.agent.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
livenessProbe:
httpGet:
path: /
port: admin
readinessProbe:
httpGet:
path: /
port: admin
{{- end }}
{{- if .Values.query.sidecars }}
{{- tpl (toYaml .Values.query.sidecars) . | nindent 6 }}
{{- end }}
dnsPolicy: {{ .Values.query.dnsPolicy }}
restartPolicy: Always
volumes:
{{- range .Values.query.extraConfigmapMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- range .Values.query.extraSecretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- if .Values.query.config}}
- name: ui-configuration
configMap:
name: {{ include "jaeger.fullname" . }}-ui-configuration
{{- end }}
{{- if .Values.storage.cassandra.tls.enabled }}
- name: {{ .Values.storage.cassandra.tls.secretName }}
secret:
secretName: {{ .Values.storage.cassandra.tls.secretName }}
{{- end }}
{{- if .Values.storage.elasticsearch.tls.enabled }}
- name: {{ .Values.storage.elasticsearch.tls.secretName }}
secret:
secretName: {{ .Values.storage.elasticsearch.tls.secretName }}
{{- end }}
{{- if .Values.query.oAuthSidecar.enabled }}
{{- range .Values.query.oAuthSidecar.extraConfigmapMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- range .Values.query.oAuthSidecar.extraSecretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- if .Values.query.oAuthSidecar.config }}
- name: jaeger-oauth-configuration
configMap:
name: {{ include "jaeger.fullname" . }}-oauth-configuration
{{- end }}
{{- end }}
{{- if .Values.query.agentSidecar.enabled }}
{{- range .Values.agent.extraSecretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
{{- end }}
{{- range .Values.agent.extraConfigmapMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
{{- end }}
{{- end }}
{{- if .Values.query.extraVolumes }}
{{- tpl (toYaml .Values.query.extraVolumes) . | nindent 8 }}
{{- end }}
{{- with .Values.query.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.query.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.query.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}