Deployment of a Microservices Application on K8s- Do MongoDB App Deployment

Deployment of a Microservices Application on K8s- Do MongoDB App Deployment

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        

  • Do cd into the directory for yml files.

cd /microservices-k8s/flask-api/k8s        

  • Next we need to apply the Task service file as it is with name taskmaster-svc.yml with using below commands.

kubectl apply -f taskmaster.yml

kubectl apply -f taskmaster-svc.yml        

Deploy MongoDB

  • Deploy MongoDB component using below commands

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!!





要查看或添加评论,请登录

Aashish R.的更多文章

  • Serverless on AWS

    Serverless on AWS

    Are you excited to know about serverless architecture!! You can build and run applications without thinking about…

  • TerraWeek Day 7 - Advanced Terraform Topics

    TerraWeek Day 7 - Advanced Terraform Topics

    Welcome to the advanced TerraWeek challenge! In this phase, we will dive into advanced topics that will enhance your…

  • TerraWeek Day 6: Terraform Providers

    TerraWeek Day 6: Terraform Providers

    Introduction In this blog, we will explore the concept of Terraform providers, compare major cloud providers such as…

    2 条评论
  • TerraWeek Day 5

    TerraWeek Day 5

    Task 1: What are modules in Terraform and why do we need modules in Terraform? You already write modules Even when you…

  • Terraweek Day 4 Knowledge about Terraform state, Local and Remote configurations

    Terraweek Day 4 Knowledge about Terraform state, Local and Remote configurations

    Task 1:The importance of Terraform state in managing infrastructure The primary purpose of Terraform state is to store…

  • TerraWeek Day 3

    TerraWeek Day 3

    Task 1:Create a Terraform configuration file to define a resource of AWS EC2 instance, Azure storage account, Google…

    1 条评论
  • HashiCorp Configuration language(HCL)

    HashiCorp Configuration language(HCL)

    #TerraWeekChallenge DAY 2 Terraform Syntax , Block parameter and arguments ,variable , data types , expressions , .tf…

  • How to Install terraform on Ubuntu server.

    How to Install terraform on Ubuntu server.

    What is Terraform? HashiCorp Terraform is an infrastructure as code tool that lets you define both cloud and on-prem…

    1 条评论
  • Deploying Reddit Copy on Kubernetes Cluster using Ingress.

    Deploying Reddit Copy on Kubernetes Cluster using Ingress.

    Prerequisites: ? EC2 (AMI- Ubuntu, Type- t2.medium) ? Docker ? Minikube ? Kubectl Follow below steps for install all…

    5 条评论

社区洞察

其他会员也浏览了