Source Code repository -
https://github.com/pradz13/K8S/tree/main/kubernetes-demo
Kubernetes Scripts repository -
https://github.com/pradz13/K8S/tree/main/kubernetes-demo-scripts
Please follow the following steps to deploy the Spring Boot application in Minikube -
- Start the Minikube - minikube start
 - Check Minikube status - minikube status
 - Allow Kubernetes to read our local Docker repository - eval $(minikube docker-env)
 - List all the Docker images - docker images
 - Navigate to project folder and create the image of the application docker build -t kubernetes-demo:1.0 .
 - Again check the list of Docker images - docker images
 - Create the K8S deployment file - deployment.yaml
 - Deploy the deployment file in the cluster with command : kubectl apply -f deployment.yaml
 - Check the deployment status : kubectl get depoyments
 - Check the running pods : kubectl get pods
 - Fetch the logs of running PODs : kubectl logs
 - Create a service.yaml for Service discovery, it will also act as a Load Balancer
 - Expose the app creating the service : kubectl apply -f service.yaml
 - Check the service status : kubectl get service
 - To get the URL type the command : minikube service kubernetes-demo-svc --url
 - Application can be accessed by the URL retrieved at step 15
 - Dashboard can be launched using the command : minikube dashboard
 
    
Top comments (0)