Skip to content

Commit

Permalink
perf: parallelize kube-proxy pulls
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Bailey committed Apr 22, 2024
1 parent 5df7547 commit 28b3f14
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions vhdbuilder/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,20 @@ rm -r /var/log/azure/Microsoft.Azure.Extensions.CustomScript || exit 1

KUBE_PROXY_IMAGE_VERSIONS=$(jq -r '.containerdKubeProxyImages.ContainerImages[0].multiArchVersions[]' <"$THIS_DIR/kube-proxy-images.json")

declare -a kubeProxyPids=()

for KUBE_PROXY_IMAGE_VERSION in ${KUBE_PROXY_IMAGE_VERSIONS}; do
# use kube-proxy as well
CONTAINER_IMAGE="mcr.microsoft.com/oss/kubernetes/kube-proxy:v${KUBE_PROXY_IMAGE_VERSION}"
pullContainerImage ${cliTool} ${CONTAINER_IMAGE} &
kubeProxyPids+=($!)
done
wait ${kubeProxyPids[@]} # Wait for all background processes to finish

for KUBE_PROXY_IMAGE_VERSION in ${KUBE_PROXY_IMAGE_VERSIONS}; do
# use kube-proxy as well
CONTAINER_IMAGE="mcr.microsoft.com/oss/kubernetes/kube-proxy:v${KUBE_PROXY_IMAGE_VERSION}"
pullContainerImage ${cliTool} ${CONTAINER_IMAGE}
ctr --namespace k8s.io run --rm ${CONTAINER_IMAGE} checkTask /bin/sh -c "iptables --version" | grep -v nf_tables && echo "kube-proxy contains no nf_tables"
ctr --namespace k8s.io run --rm ${CONTAINER_IMAGE} checkTask /bin/sh -c "iptables --version" | grep -v nf_tables && echo "kube-proxy contains no nf_tables"

# shellcheck disable=SC2181
echo " - ${CONTAINER_IMAGE}" >>${VHD_LOGS_FILEPATH}
Expand Down

0 comments on commit 28b3f14

Please sign in to comment.