{{- if or (.Values.serviceAccount.create) (.Values.presets.kubeletMetrics.enabled) -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "opentelemetry-collector.serviceAccountName" . }} labels: {{- include "opentelemetry-collector.labels" . | nindent 4 }} {{- if .Values.serviceAccount.annotations }} annotations: {{- range $key, $value := .Values.serviceAccount.annotations }} {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }} {{- end }} {{- end }} {{ end }}