agent-ds.yaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. {{- if .Values.agent.enabled -}}
  2. apiVersion: apps/v1
  3. kind: DaemonSet
  4. metadata:
  5. name: {{ template "jaeger.agent.name" . }}
  6. labels:
  7. {{- include "jaeger.labels" . | nindent 4 }}
  8. app.kubernetes.io/component: agent
  9. {{- if .Values.agent.annotations }}
  10. annotations:
  11. {{- toYaml .Values.agent.annotations | nindent 4 }}
  12. {{- end }}
  13. spec:
  14. selector:
  15. matchLabels:
  16. {{- include "jaeger.selectorLabels" . | nindent 6 }}
  17. app.kubernetes.io/component: agent
  18. {{- with .Values.agent.daemonset.updateStrategy }}
  19. updateStrategy:
  20. {{- toYaml . | nindent 4 }}
  21. {{- end }}
  22. template:
  23. metadata:
  24. {{- if .Values.agent.podAnnotations }}
  25. annotations:
  26. {{- toYaml .Values.agent.podAnnotations | nindent 8 }}
  27. {{- end }}
  28. labels:
  29. {{- include "jaeger.selectorLabels" . | nindent 8 }}
  30. app.kubernetes.io/component: agent
  31. {{- if .Values.agent.podLabels }}
  32. {{- toYaml .Values.agent.podLabels | nindent 8 }}
  33. {{- end }}
  34. spec:
  35. securityContext:
  36. {{- toYaml .Values.agent.podSecurityContext | nindent 8 }}
  37. {{- if .Values.agent.useHostNetwork }}
  38. hostNetwork: true
  39. {{- end }}
  40. dnsPolicy: {{ .Values.agent.dnsPolicy }}
  41. {{- with .Values.agent.priorityClassName }}
  42. priorityClassName: {{ . }}
  43. {{- end }}
  44. serviceAccountName: {{ template "jaeger.agent.serviceAccountName" . }}
  45. {{- with .Values.agent.imagePullSecrets }}
  46. imagePullSecrets:
  47. {{- toYaml . | nindent 8 }}
  48. {{- end }}
  49. {{- if .Values.agent.initContainers }}
  50. initContainers:
  51. {{- toYaml .Values.agent.initContainers | nindent 8 }}
  52. {{- end}}
  53. containers:
  54. - name: {{ template "jaeger.agent.name" . }}
  55. securityContext:
  56. {{- toYaml .Values.agent.securityContext | nindent 10 }}
  57. image: {{ .Values.agent.image }}:{{- .Values.agent.tag | default (include "jaeger.image.tag" .) }}
  58. imagePullPolicy: {{ .Values.agent.pullPolicy }}
  59. args:
  60. {{ include "extra.cmdArgs" ( dict "cmdlineParams" .Values.agent.cmdlineParams ) | nindent 10 }}
  61. env:
  62. {{- if .Values.agent.extraEnv }}
  63. {{- toYaml .Values.agent.extraEnv | nindent 10 }}
  64. {{- end }}
  65. {{- if not (hasKey .Values.agent.cmdlineParams "reporter.grpc.host-port") }}
  66. - name: REPORTER_GRPC_HOST_PORT
  67. value: {{ include "jaeger.collector.name" . }}:{{ .Values.collector.service.grpc.port }}
  68. {{- end }}
  69. {{- with .Values.agent.envFrom }}
  70. envFrom: {{- toYaml . | nindent 10 }}
  71. {{- end }}
  72. ports:
  73. - name: zipkin-compact
  74. containerPort: {{ .Values.agent.service.zipkinThriftPort }}
  75. protocol: UDP
  76. {{- if .Values.agent.daemonset.useHostPort }}
  77. hostPort: {{ .Values.agent.service.zipkinThriftPort }}
  78. {{- end }}
  79. - name: jaeger-compact
  80. containerPort: {{ .Values.agent.service.compactPort }}
  81. protocol: UDP
  82. {{- if .Values.agent.daemonset.useHostPort }}
  83. hostPort: {{ .Values.agent.service.compactPort }}
  84. {{- end }}
  85. - name: jaeger-binary
  86. containerPort: {{ .Values.agent.service.binaryPort }}
  87. protocol: UDP
  88. {{- if .Values.agent.daemonset.useHostPort }}
  89. hostPort: {{ .Values.agent.service.binaryPort }}
  90. {{- end }}
  91. - name: http
  92. containerPort: {{ .Values.agent.service.samplingPort }}
  93. protocol: TCP
  94. {{- if .Values.agent.daemonset.useHostPort }}
  95. hostPort: {{ .Values.agent.service.samplingPort }}
  96. {{- end }}
  97. - name: admin
  98. containerPort: 14271
  99. protocol: TCP
  100. livenessProbe:
  101. httpGet:
  102. path: /
  103. port: admin
  104. readinessProbe:
  105. httpGet:
  106. path: /
  107. port: admin
  108. resources:
  109. {{- toYaml .Values.agent.resources | nindent 10 }}
  110. volumeMounts:
  111. {{- range .Values.agent.extraConfigmapMounts }}
  112. - name: {{ .name }}
  113. mountPath: {{ .mountPath }}
  114. subPath: {{ .subPath }}
  115. readOnly: {{ .readOnly }}
  116. {{- end }}
  117. {{- range .Values.agent.extraSecretMounts }}
  118. - name: {{ .name }}
  119. mountPath: {{ .mountPath }}
  120. subPath: {{ .subPath }}
  121. readOnly: {{ .readOnly }}
  122. {{- end }}
  123. volumes:
  124. {{- range .Values.agent.extraConfigmapMounts }}
  125. - name: {{ .name }}
  126. configMap:
  127. name: {{ .configMap }}
  128. {{- end }}
  129. {{- range .Values.agent.extraSecretMounts }}
  130. - name: {{ .name }}
  131. secret:
  132. secretName: {{ .secretName }}
  133. {{- end }}
  134. {{- with .Values.agent.nodeSelector }}
  135. nodeSelector:
  136. {{- toYaml . | nindent 8 }}
  137. {{- end }}
  138. {{- with .Values.agent.affinity }}
  139. affinity:
  140. {{- toYaml . | nindent 8 }}
  141. {{- end }}
  142. {{- with .Values.agent.tolerations }}
  143. tolerations:
  144. {{- toYaml . | nindent 8 }}
  145. {{- end }}
  146. {{- end -}}