From 6b129e1f4ed3c475a78aef8984ad4336e0a12946 Mon Sep 17 00:00:00 2001 From: Nick Baker Date: Thu, 10 Oct 2024 17:37:47 +0000 Subject: [PATCH] Customize docker setup --- templates/al2/provisioners/cache-pause-container.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/al2/provisioners/cache-pause-container.sh b/templates/al2/provisioners/cache-pause-container.sh index 3cc817321..2bb719880 100755 --- a/templates/al2/provisioners/cache-pause-container.sh +++ b/templates/al2/provisioners/cache-pause-container.sh @@ -7,17 +7,20 @@ set -o pipefail AWS_DOMAIN=$(imds 'latest/meta-data/services/domain') ECR_URI="$(/etc/eks/get-ecr-uri.sh ${AWS_REGION} ${AWS_DOMAIN})" -TAG="localhost/kubernetes/pause:0.1.0" -EXPORT_PATH=/etc/eks/pause.tar +PAUSE_CONTAINER_IMAGE="${ECR_URI}/eks/pause:3.5" sudo systemctl start containerd -cache-pause-container -i "${ECR_URI}/eks/pause:3.5" -t ${TAG} -e ${EXPORT_PATH} +cache-pause-container -i ${PAUSE_CONTAINER_IMAGE} sudo systemctl stop containerd # we also need to import the image into docker, which is still default on 1.23 # and supportted below 1.25. +# NOTE: there was some difficulty importing the same image exported by ctr, so +# this part follows separately if vercmp ${KUBERNETES_VERSION} lt "1.25"; then sudo systemctl start docker - sudo docker image import ${EXPORT_PATH} ${TAG} + aws ecr get-login-password | sudo docker login --username AWS --password-stdin ${ECR_URI} + sudo docker pull ${PAUSE_CONTAINER_IMAGE} + sudo docker image tag ${PAUSE_CONTAINER_IMAGE} "localhost/kubernetes/pause:0.1.0" sudo systemctl stop docker fi