Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split admin user creation and the rest resource creationg #1538

Open
wants to merge 1 commit into
base: release-3.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions roles/ks-core/prepare/files/ks-init/admin-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: iam.kubesphere.io/v1alpha2
kind: User
metadata:
name: admin
annotations:
iam.kubesphere.io/uninitialized: "true"
spec:
email: [email protected]
password: $2a$10$zcHepmzfKPoxCVCYZr5K7ORPZZ/ySe9p/7IUb/8u./xHrnSX2LOCO
status:
state: Active
13 changes: 0 additions & 13 deletions roles/ks-core/prepare/files/ks-init/initial-account.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
---
apiVersion: iam.kubesphere.io/v1alpha2
kind: User
metadata:
name: admin
annotations:
iam.kubesphere.io/uninitialized: "true"
spec:
email: [email protected]
password: $2a$10$zcHepmzfKPoxCVCYZr5K7ORPZZ/ySe9p/7IUb/8u./xHrnSX2LOCO
status:
state: Active

---
apiVersion: v1
kind: ServiceAccount
Expand Down
7 changes: 5 additions & 2 deletions roles/ks-core/prepare/tasks/ks-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
register: kubesphere_user_check
failed_when: "kubesphere_user_check.stderr and 'NotFound' not in kubesphere_user_check.stderr"

- name: KubeSphere | Initing account
- name: KubeSphere | Initing admin account
shell: >
{{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/ks-init/initial-account.yaml
{{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/ks-init/admin-account.yaml
when:
- kubesphere_user_check.stderr is defined
- kubesphere_user_check.stderr.find("NotFound") != -1

- name: KubeSphere | Initing account
shell: >
{{ bin_dir }}/kubectl apply -f {{ kubesphere_dir }}/ks-init/initial-account.yaml