Deploying Electrochip Website on AWS EKS with ECR And Loadbalancer (ELB)


This project outlines the steps to deploy the Electrochip electrical service provider website on AWS using Elastic Kubernetes Service (EKS) and Elastic Container Registry (ECR). The solution will containerize the website using Docker and manage it with Kubernetes for scalability and reliability.
Prerequisites (Windows with Chocolatey)
Open powershell as an administrator and install chocolatey on the powershell. after install chocolatey on powershell, then we can do choco kubectl, eksctl and awscli on the powershell. https://chocolatey.org/install
AWS CLI
Choco install awscliDocker Desktop
Download Docker Desktop application and start it as an administrator. https://docs.docker.com/desktop/setup/install/windows-install/kubectl
Choco install kubernetes-clieksctl
Choco install eksctlVscode Editor
on vscode install the aws cli and kubernetes extension by navigating to extension and search for each of them.
1. Dockerised the Website by creating a docker image
Open your project folder that contains your code files and create a Dockerfile for the Electrochip website:
1…Create a Dockerfile
2.. Write the following codes to create your docker image using Nginx as the base image
- Navigate to the terminal and enter the command in 3 to build your docker image.
Type the command docker image ls
The docker image ls command lists all Docker images stored locally on your machine.
2. Create secret and access key on aws console
The aws conigure command sets up the AWS CLI (Command Line Interface) with your credentials and default settings. This is required to interact with AWS services like EKS, ECR, and others from your terminal or scripts.
It prompts you to enter four key pieces of information:
AWS Access Key ID – Your AWS account access key (from IAM)
AWS Secret Access Key – The secret key paired with your access key
Default region name – The AWS region you want to use (e.g., us-east-1)
Default output format – How AWS CLI responses are formatted (json)
To create an access key and secret key
Click on your Account profile name (SUBAIRNURUDEEN@……) Click on “Security credentials”
Click on the “Create access Key” button
Select Command Line interface (CLI), Check the “Confirmation” and click “Next” button
Give your key a description tag “mykey” and click the “Create access key” button to create your access key
Access key created successfully.
Note: Make sure you copy your secret key to somewhere safe or download it as a .csv file because once you leave this tab, you will only have access to the access key and not the secret key.
Now we need to navigate back to our vscode terminal and run the command aws configure, you will be prompted to enter your “Access key, Secret key, Region and output format”
3. Create EKS cluster
- use the command eksctl create cluster --name dev --region us-east-1 --nodegroup-name standard-workers --node-type t3.medium --nodes 3 --nodes-min 1 --nodes-max 4 --managed to create EKS cluster
3. Navigate to AWS console to verify our EKS cluster
first run the command eksctl get cluster to see our cluster and navigate to aws console to view our cluster and the nodes.
Login to aws console and search EKS Click on Elastic Kubernetes Services
Our dev cluster is created successfully
To view our 3 Nodes type EC2 in the search bar and click on EC2 to view our Nodes
4. Navigate to AWS console to create a repository for our docker image
On the console search for ECR and Click on Elastic Container registry
Click on the Create button
GIve your repository a name (electrochip) and Click the Create button
Repository (electrochip) is created succesfuly.
click on electrochip to view the push command.
4. Push docker image to Amazon Elastic Container Registry ( ECR)
Click on the the repository name (electrochip) and click on view push command. The push commands are used to push our docker image to ECR
Copy and paste (1) in the push command to authenticate docker client to your registry. you will see and output that says login succeeded
We will skip (2) because we have already build our docker image
Tag docker image by running the third command (3)
Push the docker image to ECR using the fourth command (4)
Image was successfully pushed to ECR
5. Creating Deployment
To run kubectl. Run the command aws eks update-kubeconfig - -name dev - -region us-east-1 configure your local kubectl (Kubernetes CLI) to connect to an Amazon EKS cluster named dev in the us-east-1 region.
Run the command docker image ls to list our image, and create a deployment with the image tagged as awstag/electrochip because that's the image in our ECR.
To create deployment use the command kubectl expose deployment electrochipdeployment --name=electrodeploy --type=LoadBalancer --port=80 --protocol=TCP
you can rename electrochipdeployment and electrodeploy to your desired name
use the command Kubectl get deployment to see our created deployment
5. Configure aws EKS to pull image from Elastic Container Regisry
To Configure kubernetes to pull image from ECR
Firstly run aws ecr get-login-password --region us-east-1 to get your login password.
Copy your password in a notepad.
Run this command to Configure Kubernetes to pull the image in ECR
you should replace with your actual 12-digit AWS Account ID.
For example, if your AWS Account ID is 123433769012, the command would be:
kubectl create secret docker-registry ecr-credentials --docker-server=123433769012.dkr.ecr.us-west-2.amazonaws.com --docker-username=AWS --docker-password=(PASTE YOUR PASSWORD)
5. Expose Deployment, Create Loadbalancer and access application it via web browser
To expose our application to the internet we need to create a service by running the following command to create a loadbalancer and also to expose it to the internet.
kubectl expose deployment electrochipdeployment --name=electrodeploy --type=LoadBalancer --port=80 --protocol=TCP
Run kubectl get service to get our loadbalancer EXTERNAL-IP
Paste External IP to browser to see our running electrochip application.
Conclusion
This project successfully deployed the Electrochip website on AWS EKS using Docker and ECR, creating a scalable and cloud-native solution. By leveraging Kubernetes, we ensured high availability, easy scaling, and efficient container management.
Key Achievements:
✅ Containerized the website using Docker
✅ Stored images securely in Amazon ECR
✅ Automated cluster setup with eksctl
✅ Managed deployments using kubectl
Subscribe to my newsletter
Read articles from SUBAIR NURUDEEN ADEWALE directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

SUBAIR NURUDEEN ADEWALE
SUBAIR NURUDEEN ADEWALE
Hello! I'm Subair Nurudeen Adewale, a cloud computing enthusiast and the founder of Nucloud Blog. I'm passionate about sharing knowledge and insights on cloud infrastructure, security, innovation, and the intersection of technology and design. As a cloud expert with a keen eye for user experience, I explore the latest trends and best practices in UI/UX, and how they can be applied to create intuitive, user-friendly, and seamless experiences for cloud-based applications and services. Follow Nucloud Blog for the latest updates and insights from the world of cloud computing and UI/UX design.