{{- if not .Values.security.passwordsSecretName }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "spark.passwordsSecretName" . }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
type: Opaque
data:
  {{- if .Values.security.rpc.authenticationEnabled }}
  rpc-authentication-secret: {{ "RPCDefaultSecret" | b64enc | quote }}
  {{- end }}
  {{- if .Values.security.ssl.enabled }}
  ssl-key-password: {{ randAlphaNum 10 | b64enc | quote }}
  ssl-keystore-password: {{ randAlphaNum 10 | b64enc | quote }}
  ssl-truststore-password: {{ randAlphaNum 10 | b64enc | quote }}
  {{- end }}
{{- end }}
