Skip to content

huyvp/Level1-Devops-Project

Repository files navigation

Kubernetes full stack example

Blog post will help understand about example

Create instance

Create a intance has option:

  • Instance type: t2.xlarge
  • Open traffic port in Security Group: 8080,80,22
  • Storage of 16GiB

Environment configuration

The first, we must install all sofware to use:

We can run all command in repo or create bash file and run it by bash ./bash_filename. Before deploy app, we need install istio and configuring components of istio. we just run bash file in gateway directory. we can run by command:

bash ./install_package.sh

Finnally, we need apply istio-ingressgateway to config gateway:

kubectl apply -f istio-ingressgateway.yaml

Cicd with jenkins

  1. Get permission user jenkins can use docker
sudo usermod -aG docker jenkins
  1. Install plugin kubernetes
  2. Connect jenkins to kubernetes cluster:
  • Coppy 2 folder .minikube and .kube of your user.Get permission for user jenkins can use them:
sudo cp -r .kube/ .minikube/ /var/lib/jenkins
sudo chown -R jenkins /var/lib/jenkins/.minikube/ /var/lib/jenkins/.kube/ 
  • Change the path in config of .kube folder in home folder jenkins
sudo nano /var/lib/jenkins/.kube/config
"Change PATH: (/home/ubuntu/ -> /var/lib/jenkins/"

  • Test connect with kubernetes cluster: manage jenkins/ manage nodes and clouds -> select kubernetes -> test connect
  1. Create a job pipeline:
  • Choose GitHub hook trigger for GITScm polling: make trigger

  • Choose pipeline script from SCM and add your repo and Add github webhook: get soure code of jenkinsfile from your repo

  1. Create file jekinsfile uses these helm charts to:
  • Deploy React application on Kubernetes
  • Deploy MongoDB persistance layer on Kubernetes
  • Deploy Spring Boot Backend API on Kubernetes
  • Deploy Istio and expose services using Istio VirtualService and Gateway and connect frontend to backend.
  • Deploy Prometheus and graffana and able to monitor using them.

Result

image

student app

- Try change line 16 in kubernetes-full-stack-example/react-student-management-web-app/src/App.js and push to github and check title of web

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published