0% found this document useful (0 votes)
6 views9 pages

Deployment

Uploaded by

zubairkhan983794
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Deployment

Uploaded by

zubairkhan983794
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 9

Deploying a Three-Tier Application on AWS

with Kubernetes

Step 1: Launch an EC2 Instance


1.1 Create an EC2 Instance
1. Navigate to the AWS Management Console by visiting AWS Console.
2. Click on "Services" and select "EC2" under the "Compute" section to access the EC2
Dashboard.
3. Click on "Launch Instance" and follow the wizard to create an instance.

• Choose an Amazon Machine Image (AMI) (e.g., UBUNTU AMI).


• Select an instance type (e.g., t2.micro).
• Configure instance details, including network settings and security groups. Ensure to
open inbound port 3000 to allow traffic to your application.
• Review and launch the instance.
1.2 Connect to the Instance

Step 2: Clone the Repository

Step 3: Dockerize the Frontend

1. Update package lists:

2. Install Docker:

3.2 Create Dockerfile for Frontend

3.3 Build and Run the Docker Image


1. Build the Docker image:
3.3 Build and Run the Docker Image
1.build the docker image:

2. Run the Docker container:


3.4 Test the Frontend

Next step is to install AWS CLI, but for that we need a user. So, we
will navigate to the IAM service and create a user there with
Administrator access. and 16. Create Security Credentials for
AWS CLI.

Step 4: Install AWS CLI and Push Frontend Image to ECR

4.1 Install AWS CLI


1. Install the AWS CLI on your EC2 instance.

2. Configure the AWS CLI:


4.2 Create ECR Repository
Open the AWS Management Console.
1. Navigate to Amazon ECR and click "Create repository".
2. Enter a repository name and create the repository.

4.3 Push Frontend Image to ECR

1. Follow the ECR instructions to log in to the registry.

2. Push the frontend Docker image to the ECR repository.


step 5: Dockerize the Backend

5.1 Create Dockerfile for Backend

1. In your terminal on the EC2 instance, navigate to the


backend directory of your cloned repository. Create a 2. 2.
Dockerfile for the backend application using a text editor.

5.2 Build and Run the Docker Image


1.Build the Docker image for the backend:
2. Run the Docker container for the backend:

5.3 Push Backend Image to ECR


1. Follow similar steps as in Step 4.2 to create a new repository in
Amazon ECR for the backend Docker image.

2. Push the backend Docker image to the newly created ECR repository.
Step 6: Set Up Kubernetes Cluster

1. Download and install kubectl on your EC2 instance:

2. Download and install eksctl on your EC2 instance:

6.2 Create EKS Cluster


1. Use eksctl to create an Amazon EKS cluster:
This will create the Stack. As well as all the required resources
such as two EC2 nodes, Elastic Kubernetes Service etc.

Step 7: Deploy Kubernetes Manifests

1. Use kubectl to create a Kubernetes namespace for the application:

You might also like