Files
kubernetes-samples/deploy_sample/README.md

988 B

Deploy Sample

Init minikube

minikube start

Build and publish image

cd app
./create_image.sh
docker image ls
cd ..

Deploy

cd yaml
kubectl apply -f 01-my-app-deployment.yaml
kubectl get all # This should show the 3 pods with status Running

Start service

kubectl apply -f 02-my-app-service-node-port.yaml
kubectl get all # There should be a service called my-app-service as LoadBalancer

Connect to the service

Do one of the following:

minikube service my-app-service # This should open a browser window with Hello World message
# If end the url with /ip the message should show the ip of the server that answered the petition

or

minikube tunnel # This should create a network route on the host to the service
# Just open a browser and navigate to http://127.0.0.1

Stop everything

kubectl delete service my-app-service
kubectl delete deploy my-app-deployment
minikube stop