App: ToDo List
https://www.youtube.com/watch?v=NrzrpyMLWes
-
BUILD: build image locally on your laptop: docker build . -t <DOCKER_HUB_USER>/todo-app (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
Build a Docker image from existing node.js 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>/todo-app
docker login
docker push <DOCKER_HUB_USER>/todo-app
docker-compose up -d
curl localhost:3000
cd ../Deploy-Kubernetes
kubectl create -f web-pod.yml
kubectl create -f web-service.yml
kubectl create -f db-pod.yml
kubectl create -f db-service.yml
kubectl get pods
kubectl get svc
kubectl get nodes
curl <NODE_IP>:<NODE_PORT>
ToDo app: http://dreamerslab.com/blog/en/write-a-todo-list-with-express-and-mongodb/
Source code page: https://github.com/dreamerslab/express-todo-example