Skip to content

Commit a8e98d3

Browse files
committed
k8s: wait for images to be pulled
It can take a while, so do it in a separate provisioning step. Signed-off-by: Anders F Björklund <[email protected]>
1 parent 4b3e1ea commit a8e98d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

templates/k8s.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ probes:
147147
fi
148148
hint: |
149149
See "/var/log/cloud-init-output.log" in the guest
150+
- description: "kubernetes images to be pulled"
151+
script: |
152+
#!/bin/bash
153+
set -eux -o pipefail
154+
if ! timeout 30s bash -c "images=\"$(kubeadm config images list)\"; until for image in \$images; do sudo crictl image -q \$image | grep -q sha256; done; do sleep 3; done"; then
155+
echo >&2 "k8s images are not pulled yet"
156+
exit 1
157+
fi
150158
- description: "kubeadm to be completed"
151159
script: |
152160
#!/bin/bash

0 commit comments

Comments
 (0)