Deployment of a Microservices Application on K8s- Do MongoDB App Deployment
Aashish R.
????System Engineer at Tata Consultancy Services | DevOps | Terraform | Kubernetes | Ansible | Jenkins | CI/CD | ??AWS | Docker | Grafana | GitHub | Linux |
Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.
In this blog we will deploy Flask app on K8 using https://killercoda.com/.
login to the killercoda and choose kubernetes.
DEPLOYING FLASK APP :
git clone https://github.com/LondheShubham153/microservices-k8s
cd /microservices-k8s/flask-api/k8s
kubectl apply -f taskmaster.yml
kubectl apply -f taskmaster-svc.yml
Deploy MongoDB
kubectl apply -f mongo-pv
kubectl apply -f mongo-pvc.yml
kubectl apply -f mongo.yml
Once all pods are deployed, run the below commands to check the pods and services
NOTE: Check pods are in running state or not
kubectl get pods
To check the services use below command
kubectl get svc
curl -d '{"task":"DB ka assignment ho gaya re baba"}' -H "Content-Type: application/json" -X POST https://127.0.0.1:30007/task
curl https://127.0.0.1:30007/tasks
Now open your browser and enter https://ec2-public-ip:30007 to get the app status.
Happy Learning!!