https://www.youtube.com/watch?v=zeS6OyDoy78&t=2839s
-
BUILD: build image locally on your laptop: docker build . -t <DOCKER_HUB_USER>/web (then push the image to registry)
-
DEPLOY: run app locally on your laptop: docker-compose up -d
-
DEPLOY: run app on K8s cluster: kubectl create -f
Tutorial to build and deploy a simple Python app in Kubernetes. The walkthrough is available here.
Make sure that you have access to a Kubernetes cluster.
Build a Docker image from existing Python source code and push it to Docker Hub. Replace DOCKER_HUB_USER with your Docker Hub username.
cd Build-Docker
docker build . -t <DOCKER_HUB_USER>/web
docker login
docker push <DOCKER_HUB_USER>/web
docker-compose up -d
curl localhost:3000
cd ../Deploy-Kubernetes
kubectl create -f db-pod.yml
kubectl create -f db-svc.yml
kubectl create -f web-pod.yml
kubectl create -f web-svc.yml
kubectl create -f web-rc.yml
kubectl get pods
kubectl get svc
kubectl describe svc web
kubectl get nodes
curl <NODE_IP>:<NODEPORT>