Files
devops-infra-helm-charts-gcp/helm-templates/opentelemetry-collector-0.158.1/templates/statefulset.yaml
T
2026-08-26 03:39:42 +05:30

68 lines
2.7 KiB
YAML

{{- if eq .Values.mode "statefulset" -}}
apiVersion: {{ .Values.apiVersion }}
kind: StatefulSet
metadata:
name: {{ include "opentelemetry-collector.fullname" . }}
namespace: {{ template "opentelemetry-collector.namespace" . }}
labels:
{{- include "opentelemetry-collector.labels" . | nindent 4 }}
{{- if .Values.annotations }}
annotations:
{{- range $key, $value := .Values.annotations }}
{{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
{{- end }}
{{- end }}
spec:
serviceName: {{ include "opentelemetry-collector.fullname" . }}
podManagementPolicy: {{ .Values.statefulset.podManagementPolicy }}
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
{{- if .Values.statefulset.persistentVolumeClaimRetentionPolicy.enabled }}
persistentVolumeClaimRetentionPolicy:
whenDeleted: {{ .Values.statefulset.persistentVolumeClaimRetentionPolicy.whenDeleted }}
whenScaled: {{ .Values.statefulset.persistentVolumeClaimRetentionPolicy.whenScaled }}
{{- end }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "opentelemetry-collector.selectorLabels" . | nindent 6 }}
{{- include "opentelemetry-collector.component" . | nindent 6 }}
updateStrategy:
{{- if eq .Values.rollout.strategy "RollingUpdate" }}
{{- with .Values.rollout.rollingUpdate }}
rollingUpdate:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
type: {{ .Values.rollout.strategy }}
template:
metadata:
annotations:
{{- if .Values.enableConfigChecksumAnnotation }}
{{- include "opentelemetry-collector.configTemplateChecksumAnnotation" . | nindent 8 }}
{{- end }}
{{- include "opentelemetry-collector.podAnnotations" . | nindent 8 }}
labels:
{{- include "opentelemetry-collector.selectorLabels" . | nindent 8 }}
{{- include "opentelemetry-collector.component" . | nindent 8 }}
{{- include "opentelemetry-collector.podLabels" . | nindent 8 }}
spec:
{{- with .Values.dnsPolicy }}
dnsPolicy: {{ . }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $podValues := deepCopy .Values }}
{{- $podData := dict "Values" $podValues "configmapSuffix" "-statefulset" "isAgent" false }}
{{- include "opentelemetry-collector.pod" ($podData | mustMergeOverwrite (deepCopy .)) | nindent 6 }}
hostNetwork: {{ .Values.hostNetwork }}
hostPID: {{ or .Values.hostPID .Values.presets.profiling.enabled }}
{{- with .Values.statefulset.volumeClaimTemplates }}
volumeClaimTemplates:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}