generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 518
Open
Labels
kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Description
What would you like to be cleaned:
Looking at the function to load images:
Lines 363 to 386 in 1d93e45
| # $1 cluster | |
| # $2 image | |
| function cluster_kind_load_image { | |
| # check if the command to get worker nodes could succeeded | |
| if ! $KIND get nodes --name "$1" > /dev/null 2>&1; then | |
| echo "Failed to retrieve nodes for cluster '$1'." | |
| return 1 | |
| fi | |
| # filter out 'control-plane' node, use only worker nodes to load image | |
| worker_nodes=$($KIND get nodes --name "$1" | grep -v 'control-plane') | |
| if [[ -n "$worker_nodes" ]]; then | |
| # Use docker save + ctr import directly to avoid the --all-platforms | |
| # issue with multi-arch images in DinD environments. | |
| # See: https://github.com/kubernetes-sigs/kind/issues/3795 | |
| echo "Loading image '$2' to cluster '$1'" | |
| while IFS= read -r node; do | |
| echo " Loading image to node: $node" | |
| if ! docker save "$2" | docker exec -i "$node" ctr --namespace=k8s.io images import --digests --snapshotter=overlayfs -; then | |
| echo "Failed to load image '$2' to node '$node'" | |
| return 1 | |
| fi | |
| done <<< "$worker_nodes" | |
| fi | |
| } |
I think we could load the images in parallel.
This will require calling docker save "$2" prior to the parallel loading.
Why is this needed:
To improve time to setup the cluster for testing. This especially will matter for TAS e2e tests which create 8 worker nodes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.