Skip to main content

Kubernetes Project- Deploying a Reddit clone Project.

Published 2 min readMarkdown

Prerequisites: To follow this project, you need the following tools and accounts:

  1. Aws account

  2. Dockerhub account

We have to follow the simple steps for this project

Step 1: Launching Ec2 instance

Firstly, we need to launch two ec2 instances one for the master node and the other for the worker node. For the master, we are taking the t2.medium and for the worker, we are taking the t2.mirco.

Step 2: Running the prerequisites to make the container ready

We need to run the following steps:

Step 3: Then we need to clone the code to the GitHub

We have the Dockerfile

Step 4: we are building the Docker image

Step 5: Deployment process

Let's create the deployment process for the application for that we need to create a deployment.yml file.

Now, to deploy the app you need to run following the command:

Step 6: Creating a service file

For checking the Application and creating the link.

Step 7: Exposing the app

  1. First We need to expose our deployment so use

    kubectl expose deployment reddit-clone-deployment --type=NodePort command.

  2. You can test your deployment using

    curl -L http://192.168.49.2:31000. 192.168.49.2 is a minikube ip & Port 31000 is defined in Service.yml

  3. Then We have to expose our app service

    kubectl port-forward svc/reddit-clone-service 3000:3000 --address 0.0.0.0 &

Now we can see the Application

Thanks for reading,

Mohammed Muqafamuddin.

No comments yet. Be the first to comment.

More from this blog