daemonset.yaml 1.8 KB

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