collector-deploy.yaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. {{- if .Values.collector.enabled -}}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ template "jaeger.collector.name" . }}
  6. labels:
  7. {{- include "jaeger.labels" . | nindent 4 }}
  8. app.kubernetes.io/component: collector
  9. {{- if .Values.collector.annotations }}
  10. annotations:
  11. {{- toYaml .Values.collector.annotations | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. {{- if not .Values.collector.autoscaling.enabled }}
  15. replicas: {{ .Values.collector.replicaCount }}
  16. {{- end }}
  17. selector:
  18. matchLabels:
  19. {{- include "jaeger.selectorLabels" . | nindent 6 }}
  20. app.kubernetes.io/component: collector
  21. template:
  22. metadata:
  23. annotations:
  24. checksum/config-env: {{ include (print $.Template.BasePath "/collector-configmap.yaml") . | sha256sum }}
  25. {{- if .Values.collector.podAnnotations }}
  26. {{- toYaml .Values.collector.podAnnotations | nindent 8 }}
  27. {{- end }}
  28. labels:
  29. {{- include "jaeger.selectorLabels" . | nindent 8 }}
  30. app.kubernetes.io/component: collector
  31. {{- if .Values.collector.podLabels }}
  32. {{- toYaml .Values.collector.podLabels | nindent 8 }}
  33. {{- end }}
  34. spec:
  35. {{- with .Values.collector.priorityClassName }}
  36. priorityClassName: {{ . }}
  37. {{- end }}
  38. securityContext:
  39. {{- toYaml .Values.collector.podSecurityContext | nindent 8 }}
  40. serviceAccountName: {{ template "jaeger.collector.serviceAccountName" . }}
  41. {{- with .Values.collector.imagePullSecrets }}
  42. imagePullSecrets:
  43. {{- toYaml . | nindent 8 }}
  44. {{- end }}
  45. {{- if .Values.collector.initContainers }}
  46. initContainers:
  47. {{- toYaml .Values.collector.initContainers | nindent 8 }}
  48. {{- end}}
  49. containers:
  50. - name: {{ template "jaeger.collector.name" . }}
  51. securityContext:
  52. {{- toYaml .Values.collector.securityContext | nindent 10 }}
  53. image: {{ .Values.collector.image }}:{{- .Values.collector.tag | default (include "jaeger.image.tag" .) }}
  54. imagePullPolicy: {{ .Values.collector.pullPolicy }}
  55. args:
  56. {{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.collector.cmdlineParams ) | nindent 10 }}
  57. {{- if not .Values.ingester.enabled -}}
  58. {{- include "storage.cmdArgs" . | nindent 10 }}
  59. {{- end }}
  60. env:
  61. {{- if .Values.collector.extraEnv }}
  62. {{- toYaml .Values.collector.extraEnv | nindent 10 }}
  63. {{- end }}
  64. {{- if .Values.collector.service.zipkin }}
  65. - name: COLLECTOR_ZIPKIN_HOST_PORT
  66. value: {{ .Values.collector.service.zipkin.port | quote }}
  67. {{- end }}
  68. {{- if or .Values.collector.service.otlp.grpc .Values.collector.service.otlp.http }}
  69. - name: COLLECTOR_OTLP_ENABLED
  70. value: "true"
  71. {{- end }}
  72. {{- if ne (default 4317 .Values.collector.service.otlp.grpc.port | toString ) "4317" }}
  73. - name: COLLECTOR_OTLP_GRPC_HOST_PORT
  74. value: {{ .Values.collector.service.otlp.grpc.port | quote }}
  75. {{- end }}
  76. {{- if ne (default 4318 .Values.collector.service.otlp.http.port | toString) "4318" }}
  77. - name: COLLECTOR_OTLP_HTTP_HOST_PORT
  78. value: {{ .Values.collector.service.otlp.http.port | quote }}
  79. {{- end }}
  80. {{- if .Values.ingester.enabled }}
  81. - name: SPAN_STORAGE_TYPE
  82. value: kafka
  83. {{- range $key, $value := .Values.storage.kafka.env }}
  84. - name: {{ $key | quote }}
  85. value: {{ $value | quote }}
  86. {{- end }}
  87. {{- if .Values.storage.kafka.extraEnv }}
  88. {{- toYaml .Values.storage.kafka.extraEnv | nindent 10 }}
  89. {{- end }}
  90. - name: KAFKA_PRODUCER_BROKERS
  91. value: {{ tpl (include "helm-toolkit.utils.joinListWithComma" .Values.storage.kafka.brokers) . }}
  92. - name: KAFKA_PRODUCER_TOPIC
  93. value: {{ .Values.storage.kafka.topic }}
  94. - name: KAFKA_PRODUCER_AUTHENTICATION
  95. value: {{ .Values.storage.kafka.authentication }}
  96. {{ else }}
  97. - name: SPAN_STORAGE_TYPE
  98. value: {{ .Values.storage.type }}
  99. {{- include "storage.env" . | nindent 10 }}
  100. {{- end }}
  101. {{- if .Values.collector.samplingConfig}}
  102. - name: SAMPLING_STRATEGIES_FILE
  103. value: /etc/conf/strategies.json
  104. {{- end }}
  105. ports:
  106. - containerPort: {{ .Values.collector.service.grpc.port }}
  107. name: grpc
  108. protocol: TCP
  109. - containerPort: {{ .Values.collector.service.http.port }}
  110. name: http
  111. protocol: TCP
  112. - containerPort: 14269
  113. name: admin
  114. protocol: TCP
  115. {{- if .Values.collector.service.zipkin }}
  116. - containerPort: {{ .Values.collector.service.zipkin.port }}
  117. name: zipkin
  118. protocol: TCP
  119. {{- end }}
  120. {{- if or .Values.collector.service.otlp.grpc .Values.collector.service.otlp.http }}
  121. - containerPort: {{ default 4317 .Values.collector.service.otlp.grpc.port }}
  122. name: otlp-grpc
  123. protocol: TCP
  124. - containerPort: {{ default 4318 .Values.collector.service.otlp.http.port }}
  125. name: otlp-http
  126. protocol: TCP
  127. {{- end }}
  128. readinessProbe:
  129. httpGet:
  130. path: /
  131. port: admin
  132. livenessProbe:
  133. httpGet:
  134. path: /
  135. port: admin
  136. resources:
  137. {{- toYaml .Values.collector.resources | nindent 10 }}
  138. volumeMounts:
  139. {{- range .Values.collector.extraConfigmapMounts }}
  140. - name: {{ .name }}
  141. mountPath: {{ .mountPath }}
  142. subPath: {{ .subPath }}
  143. readOnly: {{ .readOnly }}
  144. {{- end }}
  145. {{- range .Values.collector.extraSecretMounts }}
  146. - name: {{ .name }}
  147. mountPath: {{ .mountPath }}
  148. subPath: {{ .subPath }}
  149. readOnly: {{ .readOnly }}
  150. {{- end }}
  151. {{- if .Values.storage.cassandra.tls.enabled }}
  152. - name: {{ .Values.storage.cassandra.tls.secretName }}
  153. mountPath: "/cassandra-tls/ca-cert.pem"
  154. subPath: "ca-cert.pem"
  155. readOnly: true
  156. - name: {{ .Values.storage.cassandra.tls.secretName }}
  157. mountPath: "/cassandra-tls/client-cert.pem"
  158. subPath: "client-cert.pem"
  159. readOnly: true
  160. - name: {{ .Values.storage.cassandra.tls.secretName }}
  161. mountPath: "/cassandra-tls/client-key.pem"
  162. subPath: "client-key.pem"
  163. readOnly: true
  164. {{- end }}
  165. {{- if .Values.storage.elasticsearch.tls.enabled }}
  166. - name: {{ .Values.storage.elasticsearch.tls.secretName }}
  167. mountPath: "/es-tls/ca-cert.pem"
  168. subPath: "ca-cert.pem"
  169. readOnly: true
  170. {{- end }}
  171. {{- if .Values.collector.samplingConfig}}
  172. - name: strategies
  173. mountPath: /etc/conf/
  174. {{- end }}
  175. dnsPolicy: {{ .Values.collector.dnsPolicy }}
  176. restartPolicy: Always
  177. volumes:
  178. {{- range .Values.collector.extraConfigmapMounts }}
  179. - name: {{ .name }}
  180. configMap:
  181. name: {{ .configMap }}
  182. {{- end }}
  183. {{- range .Values.collector.extraSecretMounts }}
  184. - name: {{ .name }}
  185. secret:
  186. secretName: {{ .secretName }}
  187. {{- end }}
  188. {{- if .Values.collector.samplingConfig}}
  189. - name: strategies
  190. configMap:
  191. name: {{ include "jaeger.fullname" . }}-sampling-strategies
  192. {{- end }}
  193. {{- if .Values.storage.cassandra.tls.enabled }}
  194. - name: {{ .Values.storage.cassandra.tls.secretName }}
  195. secret:
  196. secretName: {{ .Values.storage.cassandra.tls.secretName }}
  197. {{- end }}
  198. {{- if .Values.storage.elasticsearch.tls.enabled }}
  199. - name: {{ .Values.storage.elasticsearch.tls.secretName }}
  200. secret:
  201. secretName: {{ .Values.storage.elasticsearch.tls.secretName }}
  202. {{- end }}
  203. {{- with .Values.collector.nodeSelector }}
  204. nodeSelector:
  205. {{- toYaml . | nindent 8 }}
  206. {{- end }}
  207. {{- with .Values.collector.affinity }}
  208. affinity:
  209. {{- toYaml . | nindent 8 }}
  210. {{- end }}
  211. {{- with .Values.collector.tolerations }}
  212. tolerations:
  213. {{- toYaml . | nindent 8 }}
  214. {{- end }}
  215. {{- end -}}