Nabeel Sulieman

Connecting Kubernetes to AWS ECR


I'm pleased to announce the release of k8s-ecr-login-renew (GitHub / Docker). It's a small tool written in Go that simplifies working with Amazon's Elastic Container Registry (ECR). It addresses the fact that ECR Docker login credentials expire every 12 hours. k8s-ecr-login-renew solves this by:

  • Fetching Docker login credentials from an AWS
  • Creating/Updating a Docker login secret in Kubernetes
  • Running as a cron job to prevent the Docker secret from expiring

The source code and Docker image are published here:

  • Source Code: https://github.com/nabsul/k8s-ecr-login-renew
  • Docker Image: https://hub.docker.com/repository/docker/nabsul/k8s-ecr-login-renew

I'm also quite proud of the README and example code. My hope is that they will make getting started extremely easy.


PS: Feedback is welcome and desired! Please also let me know if you found this tool useful (or if you had trouble using it).