← All posts

Implementing Amazon EKS: From Zero to Deploy · Part 5 of 6

Implementing Amazon Elastic Kubernetes Service: From Zero to Deploy (Part 5/6)

Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service on AWS. With it, customers such as Intel…

2 min read370 wordsSections: 1Code blocks: 17Apr 19, 2022

Keywords

Share
Comment
Implementing Amazon Elastic Kubernetes Service: From Zero to Deploy (Part 5/6)

Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service on AWS. With it, customers such as Intel, Snap, Intuit, GoDaddy and many other companies run their most sensitive and mission-critical applications thanks to its security, reliability and scalability. In this series of posts we will see how to implement Amazon EKS from scratch all the way to deploying an application. The topics we will cover:

  • Part 1 — Configuring a cluster in EKS
  • Part 2 — Configuring node-groups in EKS
  • Part 3 — Configuring IAM users as Masters
  • Part 4 — Packaging from source code
  • Part 5 — Publishing a container image to ECR
  • Part 6 — Deploying to EKS from an image in ECR

Continuing our series, we will now talk about how to publish a container image to ECR (Elastic Container Registry).

Part 5 — Publishing a container image to ECR

PUBLISHING AN IMAGE TO ECR

  • Log in to ECR
$(aws ecr get-login — no-include-email — region ca-central-1)
  • Create a repository in the ECR console
277339514346.dkr.ecr.ca-central-1.amazonaws.com/eksdeepdive
  • To create the repositories via the CLI. Remember to save the URI returned in the console:
aws ecr create-repository — repository-name photo-filter
277339514346.dkr.ecr.ca-central-1.amazonaws.com/photo-filter
aws ecr create-repository — repository-name photo-storage
277339514346.dkr.ecr.ca-central-1.amazonaws.com/photo-storage
aws ecr create-repository — repository-name web-client
277339514346.dkr.ecr.ca-central-1.amazonaws.com/web-client
  • Now you need to build the Docker images that will be stored in the ECR repository
cd apps/photo-filter/
docker build — rm -t photo-filter .
  • So you don’t have to run the builds manually, you can use docker-compose to build them all at once:
  • In the folder containing the docker-compose.yml file, run the command:
docker-compose build
  • Tag the images so they can be pushed to ECR.
docker tag photo-filter 277339514346.dkr.ecr.ca-central-1.amazonaws.com/photo-filter
docker tag photo-storage 277339514346.dkr.ecr.ca-central-1.amazonaws.com/photo-storage
docker tag web-client 277339514346.dkr.ecr.ca-central-1.amazonaws.com/web-client
  • Push the images to ECR.
docker push 277339514346.dkr.ecr.ca-central-1.amazonaws.com/photo-filter
docker push 277339514346.dkr.ecr.ca-central-1.amazonaws.com/photo-storage
docker push 277339514346.dkr.ecr.ca-central-1.amazonaws.com/web-client

In our next post, we will talk about deploying to EKS from an image in ECR.

See you then! =)

Comments

Every comment is moderated before it appears here. Nothing is published automatically.

Loading…