fix: reduce rerun bootstrap pre-pull delays
Deploy Cluster / Terraform (push) Successful in 28s
Deploy Cluster / Ansible (push) Failing after 39m26s

This commit is contained in:
2026-04-24 12:09:34 +00:00
parent 3f52bad854
commit 347ca041ba
3 changed files with 33 additions and 37 deletions
+30 -5
View File
@@ -1,12 +1,37 @@
---
- name: Pre-pull kube-vip bootstrap images into containerd
command: /usr/local/bin/ctr -n k8s.io images pull {{ item }}
shell: |
if /usr/local/bin/ctr -n k8s.io images ls -q | grep -Fx -- "{{ item }}" >/dev/null; then
echo "already present"
exit 0
fi
for attempt in 1 2 3; do
if timeout 120s /usr/local/bin/ctr -n k8s.io images pull "{{ item }}"; then
echo "pulled image"
exit 0
fi
sleep 10
done
exit 1
args:
executable: /bin/bash
register: kube_vip_image_pull
retries: 12
delay: 15
until: kube_vip_image_pull.rc == 0
loop: "{{ kube_vip_prepull_images }}"
changed_when: true
changed_when: "'pulled image' in kube_vip_image_pull.stdout"
failed_when: false
- name: Report kube-vip images that did not pre-pull after retries
debug:
msg: >-
Best-effort kube-vip image pre-pull did not complete for {{ item.item }} after
3 attempt(s): {{ item.stderr | default('no stderr') }}
loop: "{{ kube_vip_image_pull.results | default([]) }}"
loop_control:
label: "{{ item.item }}"
when: item.rc is defined and item.rc != 0
- name: Render kube-vip control plane manifest
template:
+3 -2
View File
@@ -110,11 +110,12 @@
- bootstrap-image-prepull
- name: Pre-pull Rancher bootstrap images
hosts: cluster
hosts: workers
become: true
roles:
- rancher-image-prepull
- role: rancher-image-prepull
when: rancher_image_prepull_enabled | default(false) | bool
- name: Deploy observability stack
hosts: control_plane[0]