Deploy application to kubernetes cluster using command line
- mvn clean package
- Install Minikube
- Install Kubectl
- Install DockerDesktop
- minikube start
- minikube status
- kubectl cluster-info
minikube docker-env
@FOR /f "tokens=*" %i IN ('minikube -p minikube docker-env --shell cmd') DO @%i
docker build -t app-k8s:1.0 .
docker images
kubectl create deployment app-k8s --image=app-k8s:1.0 --port=8080
kubectl get deployment
kubectl describe deployment app-k8s
kubectl get pods
kubectl logs {pod-name}
kubectl expose deployment app-k8s1 --type=NodePort
- output -> service/app-k8s1 exposed
minikube service app-k8s1 --url
copy the output url and paste in the browser and hit spring boot application endpoint like below
http://127.0.0.1:62465/hello
minikube dashboard
copy the url and see in the dashboard pods , replica set , jobs etc to see the health and delete pod etc.
- delete service
kubectl service delete app-k8s
- delete deployment
kubectl delete deployment app-k8s