Kubernetes Installation using AWS EKS Cluster

In this document, we’ll install Kubernetes v1.30 using AWS EKS Cluster.

There are two ways to create a new Kubernetes cluster with nodes in AWS EKS:

In this document, we’ll introduce the “AWS Management Console and AWS CLI” method.

Prerequisites

Before starting this tutorial, you must install and configure the following tools and resources that you need to create and manage an Amazon EKS cluster.

Create AWS EKS Cluster in AWS Console

You can refer to the YouTube video that demonstrates the steps to create an EKS cluster in the AWS console: https://www.youtube.com/watch?v=KxxgF-DAGWc

Alternatively, you can refer to the AWS documentation directly: “AWS Management Console and AWS CLI”

Uploading images to an AWS Private Registry

There are several reasons why your images might not be uploaded to a public image repository like Docker Hub. You can upload your image to an AWS private registry using the following steps:

  1. Create a new ECR repository (if not already created):

An Amazon ECR private repository contains your Docker images, Open Container Initiative (OCI) images, and OCI compatible artifacts. More information about Amazon ECR private repository: https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html

aws ecr create-repository --repository-name my-app-repo --region <region> 

Replace my-app-repo with your desired repository name and with your AWS region (e.g., us-west-1).

  1. Authenticate Docker to Your ECR Registry:

aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <account_id>.dkr.ecr.<region>.amazonaws.com 

Replace with your AWS region and <account_id> with your AWS account ID.

  1. Build Your Docker Image:

docker build -t my-app:<tag> .
  1. Tag your Docker image so that it can be pushed to your ECR repository:

docker tag my-app:<tag> <account_id>.dkr.ecr.<region>.amazonaws.com/my-app-repo:<tag>

Replace <account_id> with your AWS account ID, with your AWS region, and my-app-repo with your repository name.

  1. Push your Docker image to the ECR repository with this command:

docker push <account_id>.dkr.ecr.<region>.amazonaws.com/my-app-repo:latest