agent-ds.yaml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. ports:
  70. - name: zipkin-compact
  71. containerPort: {{ .Values.agent.service.zipkinThriftPort }}
  72. protocol: UDP
  73. {{- if .Values.agent.daemonset.useHostPort }}
  74. hostPort: {{ .Values.agent.service.zipkinThriftPort }}
  75. {{- end }}
  76. - name: jaeger-compact
  77. containerPort: {{ .Values.agent.service.compactPort }}
  78. protocol: UDP
  79. {{- if .Values.agent.daemonset.useHostPort }}
  80. hostPort: {{ .Values.agent.service.compactPort }}
  81. {{- end }}
  82. - name: jaeger-binary
  83. containerPort: {{ .Values.agent.service.binaryPort }}
  84. protocol: UDP
  85. {{- if .Values.agent.daemonset.useHostPort }}
  86. hostPort: {{ .Values.agent.service.binaryPort }}
  87. {{- end }}
  88. - name: http
  89. containerPort: {{ .Values.agent.service.samplingPort }}
  90. protocol: TCP
  91. {{- if .Values.agent.daemonset.useHostPort }}
  92. hostPort: {{ .Values.agent.service.samplingPort }}
  93. {{- end }}
  94. - name: admin
  95. containerPort: 14271
  96. protocol: TCP
  97. livenessProbe:
  98. httpGet:
  99. path: /
  100. port: admin
  101. readinessProbe:
  102. httpGet:
  103. path: /
  104. port: admin
  105. resources:
  106. {{- toYaml .Values.agent.resources | nindent 10 }}
  107. volumeMounts:
  108. {{- range .Values.agent.extraConfigmapMounts }}
  109. - name: {{ .name }}
  110. mountPath: {{ .mountPath }}
  111. subPath: {{ .subPath }}
  112. readOnly: {{ .readOnly }}
  113. {{- end }}
  114. {{- range .Values.agent.extraSecretMounts }}
  115. - name: {{ .name }}
  116. mountPath: {{ .mountPath }}
  117. subPath: {{ .subPath }}
  118. readOnly: {{ .readOnly }}
  119. {{- end }}
  120. volumes:
  121. {{- range .Values.agent.extraConfigmapMounts }}
  122. - name: {{ .name }}
  123. configMap:
  124. name: {{ .configMap }}
  125. {{- end }}
  126. {{- range .Values.agent.extraSecretMounts }}
  127. - name: {{ .name }}
  128. secret:
  129. secretName: {{ .secretName }}
  130. {{- end }}
  131. {{- with .Values.agent.nodeSelector }}
  132. nodeSelector:
  133. {{- toYaml . | nindent 8 }}
  134. {{- end }}
  135. {{- with .Values.agent.affinity }}
  136. affinity:
  137. {{- toYaml . | nindent 8 }}
  138. {{- end }}
  139. {{- with .Values.agent.tolerations }}
  140. tolerations:
  141. {{- toYaml . | nindent 8 }}
  142. {{- end }}
  143. {{- end -}}