fix: use mirror-aware crictl prepulls
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Pull bootstrap images into containerd
|
- name: Pull bootstrap images into containerd
|
||||||
shell: |
|
shell: |
|
||||||
if /usr/local/bin/ctr -n k8s.io images ls -q | grep -Fx -- "{{ item }}" >/dev/null; then
|
if /usr/local/bin/k3s crictl inspecti "{{ item }}" >/dev/null 2>&1; then
|
||||||
echo "already present"
|
echo "already present"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
for attempt in 1 2 3 4 5 6 7 8 9 10; do
|
for attempt in 1 2 3 4 5 6 7 8 9 10; do
|
||||||
echo "pull attempt ${attempt}: {{ item }}"
|
echo "pull attempt ${attempt}: {{ item }}"
|
||||||
if timeout 240s /usr/local/bin/ctr -n k8s.io images pull "{{ item }}"; then
|
if timeout 240s /usr/local/bin/k3s crictl pull "{{ item }}"; then
|
||||||
echo "pulled image"
|
echo "pulled image"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
{{ cloud_init_wait.stderr | default('') }}
|
{{ cloud_init_wait.stderr | default('') }}
|
||||||
when:
|
when:
|
||||||
- cloud_init_binary.rc == 0
|
- cloud_init_binary.rc == 0
|
||||||
- cloud_init_wait.rc == 1 or 'status: error' in (cloud_init_wait.stdout | default(''))
|
- "'status: error' in (cloud_init_wait.stdout | default(''))"
|
||||||
|
|
||||||
- name: Persist primary interface MTU for registry egress
|
- name: Persist primary interface MTU for registry egress
|
||||||
copy:
|
copy:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Pre-pull kube-vip bootstrap images into containerd
|
- name: Pre-pull kube-vip bootstrap images into containerd
|
||||||
shell: |
|
shell: |
|
||||||
if /usr/local/bin/ctr -n k8s.io images ls -q | grep -Fx -- "{{ item }}" >/dev/null; then
|
if /usr/local/bin/k3s crictl inspecti "{{ item }}" >/dev/null 2>&1; then
|
||||||
echo "already present"
|
echo "already present"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
echo "pull attempt ${attempt}: {{ item }}"
|
echo "pull attempt ${attempt}: {{ item }}"
|
||||||
if timeout 180s /usr/local/bin/ctr -n k8s.io images pull "{{ item }}"; then
|
if timeout 180s /usr/local/bin/k3s crictl pull "{{ item }}"; then
|
||||||
echo "pulled image"
|
echo "pulled image"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Pull Rancher images into containerd
|
- name: Pull Rancher images into containerd
|
||||||
shell: |
|
shell: |
|
||||||
if /usr/local/bin/ctr -n k8s.io images ls -q | grep -Fx -- "{{ item }}" >/dev/null; then
|
if /usr/local/bin/k3s crictl inspecti "{{ item }}" >/dev/null 2>&1; then
|
||||||
echo "already present"
|
echo "already present"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
for attempt in 1 2 3 4 5 6 7 8 9 10; do
|
for attempt in 1 2 3 4 5 6 7 8 9 10; do
|
||||||
echo "pull attempt ${attempt}: {{ item }}"
|
echo "pull attempt ${attempt}: {{ item }}"
|
||||||
if timeout 240s /usr/local/bin/ctr -n k8s.io images pull "{{ item }}"; then
|
if timeout 240s /usr/local/bin/k3s crictl pull "{{ item }}"; then
|
||||||
echo "pulled image"
|
echo "pulled image"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user