Skip to main content

Command Palette

Search for a command to run...

Deploying two-tier Microservice application in Kubernetes

Published
•1 min read•View as Markdown

Clone the application

git clone https://github.com/LondheShubham153/microservices-k8s.git

login to docker

docker login

Build ,tag and push image

docker build . -t mnmanish/taskmaster && docker push mnmanish/taskmaster

Create deployment file for application

vim taskmaster.yaml

image

Create service file for application

vim taskmaster-svc.yaml

image

Create mongo persistent volume

vim mongo-pv.yaml

image

Create mongo persistent volume claim

vim mongo-pvc.yaml

image

Create mongo deployment file

vim mongo.yaml

image

Create mongo service file

vim mongo-svc.yaml

image

Apply taskmaster.yaml

kubectl apply -f taskmaster.yaml

image

Apply taskmaster-svc.yaml

kubectl apply -f taskmaster-svc.yaml

image

Apply mongo-pv.yaml

kubectl apply -f mongo-pv.yaml

Apply mongo-pvc.yaml

kubectl apply -f mongo-pvc.yaml

Apply mongo.yaml

kubectl apply -f mongo.yaml

Apply mongo-svc.yaml

kubectl apply -f mongo-pvc.yaml

image

Now, on the worker node, check docker container of mongo and taskmaster is running

docker ps

image

image

Now, edit the security groups.

image

Application is running on the worker node

image

More from this blog

Untitled Publication

32 posts