infra4talos/apps-helm/code-server/templates/secrets.yaml

20 lines
735 B
YAML

{{ if or .Values.secret.generate .Values.secret.hardcoded -}}
{{ $secretName := include "code-server.fullname" . }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.secret.secretName | default $secretName }}
labels:
app.kubernetes.io/name: {{ include "code-server.name" . }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
{{ if .Values.secret.hardcoded }}
{{ .Values.secret.passwordField | default "password"}}: "{{ .Values.secret.hardcoded | b64enc }}"
{{ else }}
{{ .Values.secret.passwordField | default "password"}}: "{{ randAlphaNum 24 | b64enc }}"
{{ end }}
{{ end }}