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>
This commit is contained in:
xuesongzuo@yunify.com 2025-12-23 10:52:41 +08:00
parent 782575f49c
commit 736c63bcf5
5 changed files with 55 additions and 15 deletions

View File

@ -16,4 +16,26 @@
roles:
- download
- copy
- role: download/web-installer
when:
- .download.web_installer.download_web_installer
pre_tasks:
- name: Artifact | Set artifact file dir
when:
- .artifact_file | empty | not
set_fact:
artifact_file_dir: >-
{{ .artifact_file | dir }}/artifact
- name: Artifact | Create artifact dir
when:
- .artifact_file_dir | empty | not
command: >-
mkdir -p {{ .artifact_file_dir }}/kubekey/kubekey/
post_tasks:
- name: Artifact | Export artifact
when:
- .pack_artifact
- .artifact_file_dir | empty | not
command: |
cp kk {{ .artifact_file_dir }}/
cd {{ .artifact_file_dir }} && tar -czvf {{ .artifact_file }} *

View File

@ -1,15 +1,4 @@
---
- name: Copy | Set artifact file dir
when:
- .artifact_file | empty | not
set_fact:
artifact_file_dir: >-
{{ .artifact_file | dir }}/artifact
- name: Copy | Create artifact file dir
command: >-
mkdir -p {{ .artifact_file_dir }}/kubekey/kubekey/
- name: Artifact | Copy required binaries and images
when: .artifact_file_dir | empty | not
block:
@ -23,6 +12,3 @@
tags: ["kubernetes", "image_registry"]
- include_tasks: iso.yaml
- name: Export artifact
command: |
cd {{ .artifact_file_dir }} && tar -czvf {{ .artifact_file }} *

View File

@ -217,6 +217,10 @@ download:
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
download_image: false
download_iso: false
web_installer:
download_web_installer: false
url: >-
https://kubekey.pek3b.qingstor.com/github.com/kubesphere/web-installer/releases/latest/download/web-installer.tgz
iso_url:
base_path: >-
{{- if .download.zone | eq "cn" -}}

View File

@ -0,0 +1,16 @@
---
- name: WebInstaller | Download web installer
when:
- .download.web_installer.download_web_installer
- .download.web_installer.url | empty | not
- .artifact_file_dir | empty | not
command: |
curl -L -o {{ .artifact_file_dir }}/web-installer.tgz {{ .download.web_installer.url }}
tar -xzf "{{ .artifact_file_dir }}/web-installer.tgz" --no-same-owner -C {{ .artifact_file_dir }}
- name: WebInstaller | Init config json
when:
- .artifact_file_dir | empty | not
template:
src: config.json
dest: "{{ .artifact_file_dir }}/schema/config.json"

View File

@ -0,0 +1,12 @@
{
"kubernetes.json": {
"kubernetes": {
"kube_version": "{{ .kubernetes.kube_version }}"
},
"cri": {
{{- if .cri.container_manager | empty | not }}
"container_manager": "{{ .cri.container_manager }}"
{{- end }}
}
}
}