Skip to content

Commit 8a978cd

Browse files
feat: add web installer in artifact export func
Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com> feat: add web installer in artifact export func Signed-off-by: xuesongzuo@yunify.com <xuesongzuo@yunify.com>
1 parent 782575f commit 8a978cd

File tree

5 files changed

+60
-15
lines changed

5 files changed

+60
-15
lines changed

builtin/core/playbooks/artifact_export.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,26 @@
1616
roles:
1717
- download
1818
- copy
19-
19+
- role: download/web-installer
20+
when:
21+
- .download.web_installer.download_web_installer
22+
pre_tasks:
23+
- name: Artifact | Set artifact file dir
24+
when:
25+
- .artifact_file | empty | not
26+
set_fact:
27+
artifact_file_dir: >-
28+
{{ .artifact_file | dir }}/artifact
29+
- name: Artifact | Create artifact dir
30+
when:
31+
- .artifact_file_dir | empty | not
32+
command: >-
33+
mkdir -p {{ .artifact_file_dir }}/kubekey/kubekey/
34+
post_tasks:
35+
- name: Artifact | Export artifact
36+
when:
37+
- .pack_artifact
38+
- .artifact_file_dir | empty | not
39+
command: |
40+
cp kk {{ .artifact_file_dir }}/
41+
cd {{ .artifact_file_dir }} && tar -czvf {{ .artifact_file }} *
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
---
2-
- name: Copy | Set artifact file dir
3-
when:
4-
- .artifact_file | empty | not
5-
set_fact:
6-
artifact_file_dir: >-
7-
{{ .artifact_file | dir }}/artifact
8-
9-
- name: Copy | Create artifact file dir
10-
command: >-
11-
mkdir -p {{ .artifact_file_dir }}/kubekey/kubekey/
12-
132
- name: Artifact | Copy required binaries and images
143
when: .artifact_file_dir | empty | not
154
block:
@@ -23,6 +12,3 @@
2312
tags: ["kubernetes", "image_registry"]
2413
- include_tasks: iso.yaml
2514

26-
- name: Export artifact
27-
command: |
28-
cd {{ .artifact_file_dir }} && tar -czvf {{ .artifact_file }} *

builtin/core/roles/defaults/vars/10-download.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ download:
217217
nfs_provisioner: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/releases/download/nfs-subdir-external-provisioner-4.0.18/nfs-subdir-external-provisioner-{{ .storage_class.nfs_provisioner_version }}.tgz
218218
download_image: false
219219
download_iso: false
220+
web_installer:
221+
download_web_installer: false
222+
url: >-
223+
https://kubekey.pek3b.qingstor.com/github.com/kubesphere/web-installer/releases/latest/download/web-installer.tgz
220224
iso_url:
221225
base_path: >-
222226
{{- if .download.zone | eq "cn" -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- name: WebInstaller | Download web installer
3+
when:
4+
- .download.web_installer.download_web_installer
5+
- .download.web_installer.url | empty | not
6+
- .artifact_file_dir | empty | not
7+
command: |
8+
curl -L -o {{ .artifact_file_dir }}/web-installer.tgz {{ .download.web_installer.url }}
9+
tar -xzf "{{ .artifact_file_dir }}/web-installer.tgz" --no-same-owner -C {{ .artifact_file_dir }}
10+
11+
- name: WebInstaller | Init config json
12+
when:
13+
- .artifact_file_dir | empty | not
14+
template:
15+
src: config.json
16+
dest: "{{ .artifact_file_dir }}/schema/config.json"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"kubernetes.json": {
3+
"kubernetes": {
4+
"kube_version": "{{ .kubernetes.kube_version }}",
5+
"control_plane_endpoint": {
6+
"host": "lb.kubesphere.local",
7+
"port": 6443,
8+
"type": "local"
9+
}
10+
},
11+
"cri": {
12+
{{- if .cri.container_manager | empty | not }}
13+
"container_manager": "{{ .cri.container_manager }}"
14+
{{- end }}
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)