From 6261bfdda7db1fa752d53f5c369baf5ea6358d7c Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Sat, 12 Nov 2022 11:03:22 +0100 Subject: [PATCH] Add retries for container import; Add cluster API images --- .../roles/metacluster/tasks/assets.yml | 5 +++++ ansible/vars/metacluster.yml | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/assets.yml b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/assets.yml index 69e9e12..0dcd75e 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/assets.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/metacluster/tasks/assets.yml @@ -2,6 +2,11 @@ ansible.builtin.command: cmd: k3s ctr image import {{ item }} --digests chdir: /opt/metacluster/container-images + register: import_result loop: "{{ query('ansible.builtin.fileglob', '/opt/metacluster/container-images/*.tar') | sort }}" loop_control: label: "{{ item | basename }}" + # Probably should add a task before that ensures K3s node is fully initialized before starting imports; currently K3s goes away briefly during this loop + retries: 3 + delay: 10 + until: import_result is not failed diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index d15ec0b..7f89ef6 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -202,6 +202,18 @@ dependencies: container_images: - vmware/powerclicore:12.7 + # The following list is generated by running the following commands: + # $ clusterctl init -i vsphere: [...] + # $ clusterctl generate cluster [...] | yq eval '.data.data' | yq --no-doc eval '.. | .image? | select(.)' + - quay.io/k8scsi/csi-node-driver-registrar:v2.0.1 + - gcr.io/cloud-provider-vsphere/csi/release/driver:v2.1.0 + - quay.io/k8scsi/livenessprobe:v2.1.0 + - quay.io/k8scsi/csi-attacher:v3.0.0 + - gcr.io/cloud-provider-vsphere/csi/release/driver:v2.1.0 + - quay.io/k8scsi/livenessprobe:v2.1.0 + - gcr.io/cloud-provider-vsphere/csi/release/syncer:v2.1.0 + - quay.io/k8scsi/csi-provisioner:v2.0.0 + - gcr.io/cloud-provider-vsphere/cpi/release/manager:v1.18.1 static_binaries: - filename: clusterctl