deployment.yaml 2.0 KB

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