#minikube delete --all minikube start --driver=docker --nodes 3 minikube addons enable metrics-server
and most importantly
minikube addons enable ingress
kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0 --replicas=3 kubectl expose deployment web --type=NodePort --port=8080 kubectl get service web -o wide minikube service web --url
curl http://192.168.49.2:32577 curl http://192.168.49.2:32577 curl http://192.168.49.2:32577 curl http://192.168.49.3:32577 curl http://192.168.49.3:32577 curl http://192.168.49.3:32577 curl http://192.168.49.4:32577 curl http://192.168.49.4:32577 curl http://192.168.49.4:32577
minikube addons enable ingress kubectl get pods -n ingress-nginx vi example-ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: example-ingress annotations: nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - host: hello-world.info http: paths: - path: / pathType: Prefix backend: service: name: web port: number: 8080 kubectl apply -f example-ingress.yaml kubectl get svc kubectl get ingress
check
curl --resolve hello-world.info:80:192.168.49.2 -i http://hello-world.info # OK curl --resolve hello-world.info:80:192.168.49.3 -i http://hello-world.info # NOK curl --resolve hello-world.info:80:192.168.49.4 -i http://hello-world.info # NOK
https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/
https://kubernetes.io/docs/concepts/services-networking/ingress/
https://k8s-docs.netlify.app/en/docs/tasks/access-application-cluster/ingress-minikube/ ==> lives into kube-system ns
https://nginx.com/blog/guide-to-choosing-ingress-controller-part-4-nginx-ingress-controller-options/ ==> ingress-nginx vs nginx-ingress
https://stackoverflow.com/questions/68449554/ingress-rule-using-host
https://stackoverflow.com/questions/63474636/ingress-with-and-without-host