query-deploy.yaml 11 KB

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