query-deploy.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. ports:
  74. - name: query
  75. containerPort: 16686
  76. protocol: TCP
  77. - name: grpc
  78. containerPort: 16685
  79. protocol: TCP
  80. - name: admin
  81. containerPort: 16687
  82. protocol: TCP
  83. resources:
  84. {{- toYaml .Values.query.resources | nindent 10 }}
  85. volumeMounts:
  86. {{- range .Values.query.extraSecretMounts }}
  87. - name: {{ .name }}
  88. mountPath: {{ .mountPath }}
  89. subPath: {{ .subPath }}
  90. readOnly: {{ .readOnly }}
  91. {{- end }}
  92. {{- range .Values.query.extraConfigmapMounts }}
  93. - name: {{ .name }}
  94. mountPath: {{ .mountPath }}
  95. subPath: {{ .subPath }}
  96. readOnly: {{ .readOnly }}
  97. {{- end }}
  98. {{- if .Values.storage.cassandra.tls.enabled }}
  99. - name: {{ .Values.storage.cassandra.tls.secretName }}
  100. mountPath: "/cassandra-tls/ca-cert.pem"
  101. subPath: "ca-cert.pem"
  102. readOnly: true
  103. - name: {{ .Values.storage.cassandra.tls.secretName }}
  104. mountPath: "/cassandra-tls/client-cert.pem"
  105. subPath: "client-cert.pem"
  106. readOnly: true
  107. - name: {{ .Values.storage.cassandra.tls.secretName }}
  108. mountPath: "/cassandra-tls/client-key.pem"
  109. subPath: "client-key.pem"
  110. readOnly: true
  111. {{- end }}
  112. {{- if .Values.storage.elasticsearch.tls.enabled }}
  113. - name: {{ .Values.storage.elasticsearch.tls.secretName }}
  114. mountPath: "/es-tls/ca-cert.pem"
  115. subPath: "ca-cert.pem"
  116. readOnly: true
  117. {{- end }}
  118. {{- if .Values.query.config}}
  119. - name: ui-configuration
  120. mountPath: /etc/conf/
  121. {{- end }}
  122. livenessProbe:
  123. httpGet:
  124. path: /
  125. port: admin
  126. readinessProbe:
  127. httpGet:
  128. path: /
  129. port: admin
  130. {{- if .Values.query.oAuthSidecar.enabled }}
  131. - name: {{ template "jaeger.agent.name" . }}-oauth2-sidecar
  132. image: {{ .Values.query.oAuthSidecar.image }}
  133. imagePullPolicy: {{ .Values.query.oAuthSidecar.pullPolicy }}
  134. args:
  135. {{- range .Values.query.oAuthSidecar.args }}
  136. - {{ . }}
  137. {{- end }}
  138. {{- if .Values.query.oAuthSidecar.extraEnv }}
  139. env:
  140. {{- toYaml .Values.query.oAuthSidecar.extraEnv | nindent 10 }}
  141. {{- end }}
  142. volumeMounts:
  143. {{- range .Values.query.oAuthSidecar.extraConfigmapMounts }}
  144. - name: {{ .name }}
  145. mountPath: {{ .mountPath }}
  146. subPath: {{ .subPath }}
  147. readOnly: {{ .readOnly }}
  148. {{- end }}
  149. {{- range .Values.query.oAuthSidecar.extraSecretMounts }}
  150. - name: {{ .name }}
  151. mountPath: {{ .mountPath }}
  152. subPath: {{ .subPath }}
  153. readOnly: {{ .readOnly }}
  154. {{- end }}
  155. {{- if .Values.query.oAuthSidecar.config}}
  156. - name: jaeger-oauth-configuration
  157. mountPath: /etc/oauth2-proxy
  158. {{- end }}
  159. ports:
  160. - containerPort: {{ .Values.query.oAuthSidecar.containerPort }}
  161. name: oauth-proxy
  162. {{- if .Values.query.oAuthSidecar.livenessProbe }}
  163. livenessProbe:
  164. {{- toYaml .Values.query.oAuthSidecar.livenessProbe | nindent 10 }}
  165. {{- end }}
  166. {{- if .Values.query.oAuthSidecar.readinessProbe }}
  167. readinessProbe:
  168. {{- toYaml .Values.query.oAuthSidecar.readinessProbe | nindent 10 }}
  169. {{- end }}
  170. {{- end }}
  171. {{- if .Values.query.agentSidecar.enabled }}
  172. - name: {{ template "jaeger.agent.name" . }}-sidecar
  173. securityContext:
  174. {{- toYaml .Values.query.securityContext | nindent 10 }}
  175. image: {{ .Values.agent.image }}:{{- include "jaeger.image.tag" . }}
  176. imagePullPolicy: {{ .Values.agent.pullPolicy }}
  177. args:
  178. {{- range $key, $value := .Values.agent.cmdlineParams }}
  179. {{- if $value }}
  180. - --{{ $key }}={{ $value }}
  181. {{- else }}
  182. - --{{ $key }}
  183. {{- end }}
  184. {{- end }}
  185. env:
  186. {{- if not (hasKey .Values.agent.cmdlineParams "reporter.grpc.host-port") }}
  187. - name: REPORTER_GRPC_HOST_PORT
  188. value: {{ include "jaeger.collector.name" . }}:{{ .Values.collector.service.grpc.port }}
  189. {{- end }}
  190. ports:
  191. - name: admin
  192. containerPort: 14271
  193. protocol: TCP
  194. resources:
  195. {{- toYaml .Values.query.agentSidecar.resources | nindent 10 }}
  196. volumeMounts:
  197. {{- range .Values.agent.extraConfigmapMounts }}
  198. - name: {{ .name }}
  199. mountPath: {{ .mountPath }}
  200. subPath: {{ .subPath }}
  201. readOnly: {{ .readOnly }}
  202. {{- end }}
  203. {{- range .Values.agent.extraSecretMounts }}
  204. - name: {{ .name }}
  205. mountPath: {{ .mountPath }}
  206. subPath: {{ .subPath }}
  207. readOnly: {{ .readOnly }}
  208. {{- end }}
  209. livenessProbe:
  210. httpGet:
  211. path: /
  212. port: admin
  213. readinessProbe:
  214. httpGet:
  215. path: /
  216. port: admin
  217. {{- end }}
  218. {{- if .Values.query.sidecars }}
  219. {{- tpl (toYaml .Values.query.sidecars) . | nindent 6 }}
  220. {{- end }}
  221. dnsPolicy: {{ .Values.query.dnsPolicy }}
  222. restartPolicy: Always
  223. volumes:
  224. {{- range .Values.query.extraConfigmapMounts }}
  225. - name: {{ .name }}
  226. configMap:
  227. name: {{ .configMap }}
  228. {{- end }}
  229. {{- range .Values.query.extraSecretMounts }}
  230. - name: {{ .name }}
  231. secret:
  232. secretName: {{ .secretName }}
  233. {{- end }}
  234. {{- if .Values.query.config}}
  235. - name: ui-configuration
  236. configMap:
  237. name: {{ include "jaeger.fullname" . }}-ui-configuration
  238. {{- end }}
  239. {{- if .Values.storage.cassandra.tls.enabled }}
  240. - name: {{ .Values.storage.cassandra.tls.secretName }}
  241. secret:
  242. secretName: {{ .Values.storage.cassandra.tls.secretName }}
  243. {{- end }}
  244. {{- if .Values.storage.elasticsearch.tls.enabled }}
  245. - name: {{ .Values.storage.elasticsearch.tls.secretName }}
  246. secret:
  247. secretName: {{ .Values.storage.elasticsearch.tls.secretName }}
  248. {{- end }}
  249. {{- if .Values.query.oAuthSidecar.enabled }}
  250. {{- range .Values.query.oAuthSidecar.extraConfigmapMounts }}
  251. - name: {{ .name }}
  252. configMap:
  253. name: {{ .configMap }}
  254. {{- end }}
  255. {{- range .Values.query.oAuthSidecar.extraSecretMounts }}
  256. - name: {{ .name }}
  257. secret:
  258. secretName: {{ .secretName }}
  259. {{- end }}
  260. {{- if .Values.query.oAuthSidecar.config }}
  261. - name: jaeger-oauth-configuration
  262. configMap:
  263. name: {{ include "jaeger.fullname" . }}-oauth-configuration
  264. {{- end }}
  265. {{- end }}
  266. {{- if .Values.query.agentSidecar.enabled }}
  267. {{- range .Values.agent.extraSecretMounts }}
  268. - name: {{ .name }}
  269. secret:
  270. secretName: {{ .secretName }}
  271. {{- end }}
  272. {{- range .Values.agent.extraConfigmapMounts }}
  273. - name: {{ .name }}
  274. configMap:
  275. name: {{ .configMap }}
  276. {{- end }}
  277. {{- end }}
  278. {{- if .Values.query.extraVolumes }}
  279. {{- tpl (toYaml .Values.query.extraVolumes) . | nindent 8 }}
  280. {{- end }}
  281. {{- with .Values.query.nodeSelector }}
  282. nodeSelector:
  283. {{- toYaml . | nindent 8 }}
  284. {{- end }}
  285. {{- with .Values.query.affinity }}
  286. affinity:
  287. {{- toYaml . | nindent 8 }}
  288. {{- end }}
  289. {{- with .Values.query.tolerations }}
  290. tolerations:
  291. {{- toYaml . | nindent 8 }}
  292. {{- end }}
  293. {{- end -}}