{{- if not .Values.stackstate.manageOwnSecrets }} apiVersion: v1 kind: Secret metadata: name: {{ include "stackstate-k8s-agent.fullname" . }} namespace: {{ .Release.Namespace }} labels: {{ include "stackstate-k8s-agent.labels" . | indent 4 }} {{ include "stackstate-k8s-agent.global.extraLabels" . | indent 4 }} annotations: {{ include "stackstate-k8s-agent.global.extraAnnotations" . | indent 4 }} type: Opaque data: {{- if .Values.global.receiverApiKey }} sts-api-key: {{ .Values.global.receiverApiKey | b64enc | quote }} {{- else }} sts-api-key: {{ .Values.stackstate.apiKey | b64enc | quote }} {{- end }} {{- if .Values.stackstate.cluster.authToken }} sts-cluster-auth-token: {{ .Values.stackstate.cluster.authToken | b64enc | quote }} {{- else }} sts-cluster-auth-token: {{ randAlphaNum 32 | b64enc | quote }} {{- end }} {{- range $key, $value := .Values.global.extraEnv.secret }} {{ $key }}: {{ $value | b64enc | quote }} {{- end }} {{- end }}