coachmaxz / microservices-with-docker

Building a microservice system with Docker (Swarm & Kubernetes)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microservices with Docker 101

Building a microservice system with Docker 101

Working with Docker Swarm

After we set up the microservices with Docker Swarm, we can access http://localhost:8000.

Creating a Cluster

docker swarm init
docker stack deploy swarm101 -c swarm/docker-compose.yml

or

fab localhost setup_swarm

Terminating a Cluster

docker swarm leave --force

or

fab localhost leave_swarm

Working with Kubernetes (k8s)

Let's run Minikube before we go on.

minikube start

After we set up the microservices with Docker Swarm, we can access http://192.168.99.100:32500/, where 192.168.99.100 is the IP of the Minikube machine.

Creating a Cluster

kubectl create -f k8s/bangkok-deployment.yml
kubectl create -f k8s/tokyo-deployment.yml
kubectl create -f k8s/nyc-deployment.yml
kubectl create -f k8s/munich-deployment.yml
kubectl create -f k8s/front-gateway-deployment.yml

kubectl create -f k8s/bangkok-svc.yml
kubectl create -f k8s/tokyo-svc.yml
kubectl create -f k8s/nyc-svc.yml
kubectl create -f k8s/munich-svc.yml
kubectl create -f k8s/front-gateway-svc.yml

or

fab localhost setup_k8s

Terminating a Cluster

kubectl delete -f k8s/bangkok-deployment.yml
kubectl delete -f k8s/tokyo-deployment.yml
kubectl delete -f k8s/nyc-deployment.yml
kubectl delete -f k8s/munich-deployment.yml
kubectl delete -f k8s/front-gateway-deployment.yml

kubectl delete -f k8s/bangkok-svc.yml
kubectl delete -f k8s/tokyo-svc.yml
kubectl delete -f k8s/nyc-svc.yml
kubectl delete -f k8s/munich-svc.yml
kubectl delete -f k8s/front-gateway-svc.yml

or

fab localhost delete_k8s

About

Building a microservice system with Docker (Swarm & Kubernetes)

License:MIT License


Languages

Language:Python 79.3%Language:HTML 16.5%Language:Go 3.2%Language:Ruby 1.0%