inital admin account

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-05-21 09:10:13 +00:00
parent 7b565e2412
commit f7d7ed55ff
2 changed files with 25 additions and 0 deletions

View File

@@ -61,3 +61,15 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Returns user's password or use default
*/}}
{{- define "getOrDefaultPass" }}
{{- $pws := (lookup "iam.kubesphere.io/v1alpha2" "User" "" .Name) -}}
{{- if $pws }}
{{- $pws.spec.password -}}
{{- else -}}
{{- .Default -}}
{{- end -}}
{{- end }}

View File

@@ -0,0 +1,13 @@
---
apiVersion: iam.kubesphere.io/v1alpha2
kind: User
metadata:
name: admin
annotations:
iam.kubesphere.io/uninitialized: "true"
helm.sh/resource-policy: keep
spec:
email: admin@kubesphere.io
password: "{{ include "getOrDefaultPass" (dict "Name" "admin" "Default" "$2a$10$zcHepmzfKPoxCVCYZr5K7ORPZZ/ySe9p/7IUb/8u./xHrnSX2LOCO") }}"
status:
state: Active