{{- if and (.Values.loki.configAsSecret) (not .Values.loki.existingSecretForConfig) -}} apiVersion: v1 kind: Secret metadata: name: {{ include "loki.fullname" . }}-config namespace: {{ .Release.Namespace }} labels: {{- include "loki.labels" . | nindent 4 }} foo: bar stringData: config.yaml: | {{- tpl (mergeOverwrite (tpl .Values.loki.config . | fromYaml) .Values.loki.structuredConfig | toYaml) . | nindent 4 }} {{- end -}}