- Newest
- Most votes
- Most comments
There has been no change in where the pause container image is hosted. On AL2023-based EKS AMIs, we've removed the dependency on an external registry altogether -- the image is included in the AMI.
Which EKS AMI are you using?
The issue you're facing with EKS version 1.30 and the sandbox image (pause:3.8) being pulled from registry.k8s.io rather than AWS ECR is indeed related to the way EKS has been configured for sandbox images in this newer version. In earlier versions like EKS 1.28, the pause container image was hosted in Amazon ECR, which is accessible by default for instances with appropriate IAM permissions in an EKS environment.
Options to Resolve the Issue Without a Proxy Server:
-
Override the Sandbox Image to Use ECR:
- You can configure the kubelet on your worker nodes to pull the sandbox image from Amazon ECR instead of
registry.k8s.io. This approach avoids the need for a proxy server. - To do this, you would modify the
kubeletconfiguration on your worker nodes to point to the ECR-hosted pause image. This can be done by customizing thebootstrap.shscript in your Launch Template.
Here’s how you could modify the script:
bash sed -i 's|registry.k8s.io/pause:3.8|602401143452.dkr.ecr.ap-southeast-1.amazonaws.com/eks/pause:3.5|' /etc/eks/bootstrap.shThis command changes the default sandbox image to the ECR-hosted image that’s accessible within your environment.
Steps:
- Create a custom AMI by launching an instance using the EKS AMI, then modify the
bootstrap.shscript with the abovesedcommand. - Create an image of this instance and use it in your Launch Template for the self-managed node group.
- You can configure the kubelet on your worker nodes to pull the sandbox image from Amazon ECR instead of
-
Mirror the
pauseImage in ECR:- Another approach is to manually pull the
pause:3.8image fromregistry.k8s.io, tag it, and push it to your own ECR repository. Then, configure thekubeletto pull the image from your private ECR.
Steps:
- Pull the
pause:3.8image to your local machine or an environment with internet access:bash docker pull registry.k8s.io/pause:3.8 - Tag the image for your ECR repository:
bash docker tag registry.k8s.io/pause:3.8 <your_account_id>.dkr.ecr.<region>.amazonaws.com/eks/pause:3.8 - Push the image to your ECR repository:
aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <your_account_id>.dkr.ecr.<region>.amazonaws.com docker push <your_account_id>.dkr.ecr.<region>.amazonaws.com/eks/pause:3.8 - Update the
bootstrap.shscript in your nodegroup launch template or custom AMI to use the ECR-hosted image:bash sed -i 's|registry.k8s.io/pause:3.8|<your_account_id>.dkr.ecr.<region>.amazonaws.com/eks/pause:3.8|' /etc/eks/bootstrap.sh
- Another approach is to manually pull the
-
Use SSM to Update Nodes After Launch:
- If you do not want to create a custom AMI, you can use an AWS Systems Manager (SSM) automation or a user data script in your launch template to apply the above
sedcommand to modify thebootstrap.shscript after the node launches.
- If you do not want to create a custom AMI, you can use an AWS Systems Manager (SSM) automation or a user data script in your launch template to apply the above
-
Allow Access to
registry.k8s.iovia NAT Gateway:-
If modifying the sandbox image isn’t feasible, consider allowing your nodes access to the internet via a NAT Gateway. This way, they can pull images from
registry.k8s.iodirectly. -
Steps:
- Ensure that your VPC has a NAT Gateway configured.
- Attach the route table for the private subnet where your worker nodes reside to the NAT Gateway.
- Confirm that the worker nodes can reach
registry.k8s.io.
-
To resolve the issue without setting up a proxy server, you can either override the pause image in the bootstrap.sh script to point to an ECR-hosted image, mirror the pause:3.8 image in your own ECR, or ensure that your nodes have internet access via a NAT Gateway.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
