daemonset.yaml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {{- if eq .Values.mode "daemonset" -}}
  2. apiVersion: apps/v1
  3. kind: DaemonSet
  4. metadata:
  5. name: {{ include "opentelemetry-collector.fullname" . }}-agent
  6. labels:
  7. {{- include "opentelemetry-collector.labels" . | nindent 4 }}
  8. {{- if .Values.annotations }}
  9. annotations:
  10. {{- range $key, $value := .Values.annotations }}
  11. {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
  12. {{- end }}
  13. {{- end }}
  14. spec:
  15. selector:
  16. matchLabels:
  17. {{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
  18. {{- include "opentelemetry-collector.component" . | nindent 6 }}
  19. updateStrategy:
  20. {{- if eq .Values.rollout.strategy "RollingUpdate" }}
  21. {{- with .Values.rollout.rollingUpdate }}
  22. rollingUpdate:
  23. {{- toYaml . | nindent 6 }}
  24. {{- end }}
  25. {{- end }}
  26. type: {{ .Values.rollout.strategy }}
  27. template:
  28. metadata:
  29. annotations:
  30. checksum/config: {{ include (print $.Template.BasePath "/configmap-agent.yaml") . | sha256sum }}
  31. {{- include "opentelemetry-collector.podAnnotations" . | nindent 8 }}
  32. labels:
  33. {{- include "opentelemetry-collector.selectorLabels" . | nindent 8 }}
  34. {{- include "opentelemetry-collector.component" . | nindent 8 }}
  35. {{- include "opentelemetry-collector.podLabels" . | nindent 8 }}
  36. spec:
  37. {{- $podValues := deepCopy .Values }}
  38. {{- $podData := dict "Values" $podValues "configmapSuffix" "-agent" "isAgent" true }}
  39. {{- include "opentelemetry-collector.pod" ($podData | mustMergeOverwrite (deepCopy .)) | nindent 6 }}
  40. hostNetwork: {{ .Values.hostNetwork }}
  41. {{- with .Values.dnsPolicy }}
  42. dnsPolicy: {{ . }}
  43. {{- end }}
  44. {{- end }}