Skip to content

Commit

Permalink
templates(al2): use ecr-credential-provider for public.ecr.aws in 1.27+
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon committed Sep 4, 2024
1 parent 3c822f5 commit e14905d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates/al2/provisioners/install-worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ fi
sudo chmod +x $ECR_CREDENTIAL_PROVIDER_BINARY
sudo mkdir -p /etc/eks/image-credential-provider
sudo mv $ECR_CREDENTIAL_PROVIDER_BINARY /etc/eks/image-credential-provider/
# ecr-credential-provider has support for public.ecr.aws in 1.27+
if vercmp "${KUBERNETES_VERSION}" gteq "1.27.0"; then
ECR_CRED_PROVIDER_CONFIG_WITH_PUBLIC=$(cat $WORKING_DIR/ecr-credential-provider-config.json | jq '.providers[0].matchImages += ["public.ecr.aws"]')
echo "${ECR_CRED_PROVIDER_CONFIG_WITH_PUBLIC}" > $WORKING_DIR/ecr-credential-provider-config.json
fi
sudo mv $WORKING_DIR/ecr-credential-provider-config.json /etc/eks/image-credential-provider/config.json

################################################################################
Expand Down

0 comments on commit e14905d

Please sign in to comment.