mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
Merge a2d45d5535 into 238eb2b8f6
This commit is contained in:
commit
9a16666210
|
|
@ -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 }} *
|
||||
|
|
|
|||
|
|
@ -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 }} *
|
||||
|
|
|
|||
|
|
@ -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" -}}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
- hosts:
|
||||
- kube_control_plane[0]
|
||||
vars_files:
|
||||
- vars/kubesphere.yaml
|
||||
tasks:
|
||||
- name: Copy KubeSphere Helm package to remote host
|
||||
copy:
|
||||
src: ks-core.tgz
|
||||
dest: /etc/kubesphere/ks-core.tgz
|
||||
- name: Generate values file from schema
|
||||
run_once: true
|
||||
copy:
|
||||
content: >-
|
||||
{{ index . "ks-core" | toYaml }}
|
||||
dest: >-
|
||||
/etc/kubesphere/value.yaml
|
||||
- name: Deploy or upgrade KubeSphere using Helm
|
||||
command: |
|
||||
helm upgrade --install --wait --create-namespace --namespace kubesphere-system -f /etc/kubesphere/value.yaml \
|
||||
ks-core /etc/kubesphere/ks-core.tgz --reset-values \
|
||||
--set telemetry.posthog.storage.type=pvc,telemetry.posthog.storage.pvc.resources.requests.storage=10Gi
|
||||
- name: Output KubeSphere console access information
|
||||
result:
|
||||
address: http://{{ .internal_ipv4 }}:30880
|
||||
user: admin
|
||||
password: P@88w0rd
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
- hosts:
|
||||
- kube_control_plane[0]
|
||||
vars_files:
|
||||
- vars/kubesphere.yaml
|
||||
tasks:
|
||||
- name: Copy KubeSphere Helm package to remote host
|
||||
copy:
|
||||
src: ks-core.tgz
|
||||
dest: /etc/kubesphere/ks-core.tgz
|
||||
- name: Generate values file from schema
|
||||
run_once: true
|
||||
copy:
|
||||
content: >-
|
||||
{{ index . "ks-core" | toYaml }}
|
||||
dest: >-
|
||||
/etc/kubesphere/value.yaml
|
||||
- name: Deploy or upgrade KubeSphere using Helm
|
||||
command: |
|
||||
helm upgrade --install --wait --create-namespace --namespace kubesphere-system -f /etc/kubesphere/value.yaml \
|
||||
ks-core /etc/kubesphere/ks-core.tgz --reset-values \
|
||||
--set telemetry.posthog.storage.type=pvc,telemetry.posthog.storage.pvc.resources.requests.storage=10Gi
|
||||
- name: Output KubeSphere console access information
|
||||
result:
|
||||
address: http://{{ .internal_ipv4 }}:30880
|
||||
user: admin
|
||||
password: P@88w0rd
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- 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 | Set Ks Core
|
||||
when:
|
||||
- .download.kse_chart_version | empty | not
|
||||
block:
|
||||
- name: WebInstaller | Download ks core chart
|
||||
command: |
|
||||
helm pull oci://hub.kubesphere.com.cn/kse/ks-core --version {{ .download.kse_chart_version }} -d {{ .artifact_file_dir }}/kubesphere/playbooks/files/
|
||||
mv {{ .artifact_file_dir }}/kubesphere/playbooks/files/ks-core-{{ .download.kse_chart_version }}.tgz {{ .artifact_file_dir }}/kubesphere/playbooks/files/ks-core.tgz
|
||||
- name: WebInstaller | Set ks core install task
|
||||
copy:
|
||||
src: "install-{{ .download.kse_chart_version }}.yaml"
|
||||
dest: "{{ .artifact_file_dir }}/kubesphere/playbooks/install.yaml"
|
||||
|
||||
- name: WebInstaller | Init config json
|
||||
when:
|
||||
- .artifact_file_dir | empty | not
|
||||
template:
|
||||
src: config.json
|
||||
dest: "{{ .artifact_file_dir }}/schema/config.json"
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"kubernetes.json": {
|
||||
"kubernetes": {
|
||||
"kube_version": "{{ .kubernetes.kube_version }}",
|
||||
"control_plane_endpoint": {
|
||||
"host": "lb.kubesphere.local",
|
||||
"port": 6443,
|
||||
"type": "local"
|
||||
}
|
||||
},
|
||||
"cri": {
|
||||
{{- if .cri.container_manager | empty | not }}
|
||||
"container_manager": "{{ .cri.container_manager }}"
|
||||
{{- end }}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue