statefulset.yaml 1.7 KB

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