emulate multiple nodes with minikube
#minikube delete --all minikube start --driver=docker --nodes 2 docker ps minikube status kubectl get nodes -o wide minikube addons enable metrics-server
kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0 --replicas=3 kubectl get deploy -o wide kubectl get pods -o wide
==> here one pod on node1 and two pods on node2
kubectl expose deployment web --type=NodePort --port=8080 kubectl get svc -o wide
and check
curl http://192.168.49.2:30329 curl http://192.168.49.3:30329
==> goes to 3 different hostnames/pods whatever node you are talking to
note it will always go to the same pod if you use a web browser… (thanks to the keepalive feature that is enabled by default)
NodePort is already balancing across the cluster, not sure what this is useful for
#kubectl expose deployment web --type=LoadBalancer --port=8080
https://minikube.sigs.k8s.io/docs/start/
https://kubernetes.io/docs/tutorials/hello-minikube/
https://minikube.sigs.k8s.io/docs/tutorials/multi_node/
https://minikube.sigs.k8s.io/docs/tutorials/multi_node/
https://pet2cattle.com/2021/01/multinode-minikube