{{- if .Values.postgresql.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "astron-agent.fullname" . }}-postgres-secret
  labels:
    {{- include "astron-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
  postgres-password: {{ .Values.postgresql.auth.password | quote }}
---
{{- end }}
{{- if .Values.mysql.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "astron-agent.fullname" . }}-mysql-secret
  labels:
    {{- include "astron-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
  mysql-root-password: {{ .Values.mysql.auth.rootPassword | quote }}
---
{{- end }}
{{- if .Values.redis.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "astron-agent.fullname" . }}-redis-secret
  labels:
    {{- include "astron-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
  redis-password: {{ default "" .Values.redis.auth.password | quote }}
---
{{- end }}
{{- if .Values.minio.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "astron-agent.fullname" . }}-minio-secret
  labels:
    {{- include "astron-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
  root-user: {{ .Values.minio.auth.rootUser | quote }}
  root-password: {{ .Values.minio.auth.rootPassword | quote }}
---
{{- end }}
{{- if .Values.casdoor.enabled }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "astron-agent.fullname" . }}-casdoor-mysql-secret
  labels:
    {{- include "astron-agent.labels" . | nindent 4 }}
type: Opaque
stringData:
  mysql-root-password: {{ .Values.casdoor.mysql.rootPassword | quote }}
  mysql-password: {{ .Values.casdoor.mysql.password | quote }}
{{- end }}
