Deploy a Reddit Clone with Kubernetes Ingress Project😍
Hi! My name is Safia Khatoon. I am complete my Bachelors in Technology from RTC Institute Of Technology. My specialisation in Computer Science and Engineering.I love contributing to Open Source with the help of the skills I gain.
Also, I'm working on my YouTube Channel as well where I teach about DevOps tools and make technical content. You can have a look at it through my profile.
Feel free to reach out to me! I'd be happy to connect with you.
Project Architecture :

pre-requests for this project :
clone the code from GitHub
build the docker image
push the image in the docker hub
deploy the code in Kubernetes
Step 1 :
Create Two Servers:
t2.micro - CI SERVER
t2.medium- Deployment Server

Step: 2
Clone the Code

step : 3
Install Docker in your CI Server
sudo apt-get update
sudo apt-get install docker.io -y

sudo usermod -aG docker $USER && newgrp docker

git clone https://github.com/LondheShubham153/reddit-clone-k8s-ingress.git

Step: 4
Build the Docker Image

docker build . -t safiakhatoon/reddit-clone

docker images

Push the image into DockerHub
docker login
docker push safiakhatoon/reddit-clone:latest

In DockerHub

Step: 5(Deployment Server)
Install Docker
sudo apt-get update
sudo apt-get install docker.io -y

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube
sudo snap install kubectl --classic
minikube start --driver=docker

Step: 6
mkdir reddit project
vim deployment.yaml

kubectl apply -f deployment.yml

kubectl get deployment

vim service.yml

kubectl apply -f service.yml

minikube service reddit-clone-service --url
curl -L http://192.168.49.2:31000

Expose the app
kubectl expose deployment reddit-clone-deployment --type=NodePort

open 3000 port

kubectl port-forward svc/reddit-clone-service 3000:3000 --address 0.0.0.0 &
copy your public IP and port 3000
ex : http://23.22.154.54:3000/

*****************************Deployment is Done*****************************
step: 7 (INGRESS)
what is ingress?
In simple terms, Ingress is a Kubernetes object that allows external users to access services running inside a Kubernetes cluster. It acts as a gateway or entry point for incoming traffic to reach the services running inside the cluster.
why ingress is used?
Ingress is used to allow external users to access services running inside a Kubernetes cluster. It acts as a gateway or entry point for incoming traffic to reach the services running inside the cluster. It provides a way to route traffic to different services based on the URL path or domain name and also enables the use of SSL/TLS encryption for secure communication.
minikube addons enable ingress

vim ingress.yml


kubectl apply -f ingress.yml

curl -L domain.com/test

Thank you for reading this blog. Hope it helps.
— Safia Khatoon
Happy Learning :)