download_file for kata (#7393)

This commit is contained in:
Samuel Liu 2021-03-23 16:39:36 +08:00 committed by GitHub
parent efa180392b
commit 12873f916b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 12 deletions

View file

@ -1,7 +1,4 @@
---
kata_containers_version: 1.11.3
kata_containers_release_url: https://github.com/kata-containers/runtime/releases/download/{{ kata_containers_version }}/kata-static-{{ kata_containers_version }}-{{ ansible_architecture }}.tar.xz
kata_containers_dir: /opt/kata
kata_containers_config_dir: /etc/kata-containers
kata_containers_containerd_bin_dir: /usr/local/bin

View file

@ -1,24 +1,29 @@
---
- name: kata-containers | Download kata binary
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download: "{{ download_defaults | combine(downloads.kata_containers) }}"
- name: Download artifacts
- name: kata-containers | Copy kata-containers binary
unarchive:
src: "{{ kata_containers_release_url }}"
dest: /
remote_src: true
src: "{{ local_release_dir }}/kata-static-{{ kata_containers_version }}-{{ image_arch }}.tar.xz"
dest: "/"
mode: 0755
remote_src: yes
- name: Create config directory
- name: kata-containers | Create config directory
file:
path: "{{ kata_containers_config_dir }}"
state: directory
- name: Set configuration
- name: kata-containers | Set configuration
template:
src: "{{ item }}.j2"
dest: "{{ kata_containers_config_dir }}/{{ item }}"
with_items:
- configuration-qemu.toml
- name: Set containerd bin
- name: kata-containers | Set containerd bin
vars:
shim: "{{ item }}"
template:

View file

@ -52,6 +52,7 @@ image_arch: "{{host_architecture | default('amd64')}}"
kubeadm_version: "{{ kube_version }}"
etcd_version: v3.4.13
crun_version: 0.18
kata_containers_version: 1.11.3
# gcr and kubernetes image repo define
gcr_image_repo: "gcr.io"
@ -103,6 +104,7 @@ calico_crds_download_url: "https://github.com/projectcalico/calico/archive/{{ ca
crictl_download_url: "https://github.com/kubernetes-sigs/cri-tools/releases/download/{{ crictl_version }}/crictl-{{ crictl_version }}-{{ ansible_system | lower }}-{{ image_arch }}.tar.gz"
helm_download_url: "https://get.helm.sh/helm-{{ helm_version }}-linux-{{ image_arch }}.tar.gz"
crun_download_url: "https://github.com/containers/crun/releases/download/{{ crun_version }}/crun-{{ crun_version }}-linux-{{ image_arch }}"
kata_containers_download_url: "https://github.com/kata-containers/runtime/releases/download/{{ kata_containers_version }}/kata-static-{{ kata_containers_version }}-{{ ansible_architecture }}.tar.xz"
crictl_checksums:
arm:
@ -473,6 +475,14 @@ crun_checksums:
0.17: 0
0.18: e580157bc8f87114a2f1d8ac28f8a7c4a588dfa21969fc99f78919cb9bf3ed0a
kata_containers_binary_checksums:
arm:
1.11.3: 0
amd64:
1.11.3: edbee010e913de980ab104958d7a6fc8394ea069038ad8c6210db36620284364
arm64:
1.11.3: 0
etcd_binary_checksum: "{{ etcd_binary_checksums[image_arch] }}"
cni_binary_checksum: "{{ cni_binary_checksums[image_arch] }}"
kubelet_binary_checksum: "{{ kubelet_checksums[image_arch][kube_version] }}"
@ -483,6 +493,7 @@ calico_crds_archive_checksum: "{{ calico_crds_archive_checksums[calico_version]
crictl_binary_checksum: "{{ crictl_checksums[image_arch][crictl_version] }}"
helm_archive_checksum: "{{ helm_archive_checksums[image_arch][helm_version] }}"
crun_binary_checksum: "{{ crun_checksums[image_arch][crun_version] }}"
kata_containers_binary_checksum: "{{ kata_containers_binary_checksums[image_arch][kata_containers_version] }}"
# Containers
# In some cases, we need a way to set --registry-mirror or --insecure-registry for docker,
@ -750,6 +761,19 @@ downloads:
groups:
- k8s-cluster
kata_containers:
enabled: "{{ kata_containers_enabled }}"
file: true
version: "{{ kata_containers_version }}"
dest: "{{ local_release_dir }}/kata-static-{{ kata_containers_version }}-{{ image_arch }}.tar.xz"
sha256: "{{ kata_containers_binary_checksum }}"
url: "{{ kata_containers_download_url }}"
unarchive: false
owner: "root"
mode: "0755"
groups:
- k8s-cluster
cilium:
enabled: "{{ kube_network_plugin == 'cilium' or cilium_deploy_additionally | default(false) | bool }}"
container: true