deployment.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{- if eq .Values.mode "deployment" -}}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ include "opentelemetry-collector.fullname" . }}
  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. {{- if not .Values.autoscaling.enabled }}
  16. replicas: {{ .Values.replicaCount }}
  17. {{- end }}
  18. revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
  19. selector:
  20. matchLabels:
  21. {{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
  22. {{- include "opentelemetry-collector.component" . | nindent 6 }}
  23. strategy:
  24. {{- if eq .Values.rollout.strategy "RollingUpdate" }}
  25. {{- with .Values.rollout.rollingUpdate }}
  26. rollingUpdate:
  27. {{- toYaml . | nindent 6 }}
  28. {{- end }}
  29. {{- end }}
  30. type: {{ .Values.rollout.strategy }}
  31. template:
  32. metadata:
  33. annotations:
  34. checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
  35. {{- include "opentelemetry-collector.podAnnotations" . | nindent 8 }}
  36. labels:
  37. {{- include "opentelemetry-collector.selectorLabels" . | nindent 8 }}
  38. {{- include "opentelemetry-collector.component" . | nindent 8 }}
  39. {{- include "opentelemetry-collector.podLabels" . | nindent 8 }}
  40. spec:
  41. {{- $podValues := deepCopy .Values }}
  42. {{- $podData := dict "Values" $podValues "configmapSuffix" "" "isAgent" false }}
  43. {{- include "opentelemetry-collector.pod" ($podData | mustMergeOverwrite (deepCopy .)) | nindent 6 }}
  44. hostNetwork: {{ .Values.hostNetwork }}
  45. {{- end }}