What is an Ingress?

Kubernetes Ingress vs LoadBalancer vs NodePort

These options all do the same thing. They let you expose a service to external network requests. They let you send a request from outside the Kubernetes cluster to a service inside the cluster.

NodePort

LoadBalancer

Ingress

How to Use Nginx Ingress Controller

 kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
 minikube addons enable ingress
 kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml
 kubectl get pods --all-namespaces -l app=ingress-nginx

Creating a Kubernetes Ingress

git clone https://github.com/collabnix/kubelabs
cd ingress101
$ kubectl apply -f apple.yaml
$ kubectl apply -f banana.yaml
kubectl create -f ingress.yaml

Perfect! Let’s check that it’s working. If you’re using Minikube, you might need to replace localhost with minikube IP.

$ curl -kL http://localhost/apple
apple

$ curl -kL http://localhost/banana
banana

$ curl -kL http://localhost/notfound
default backend - 404

Ingress Controllers and Ingress Resources

Next: Ingress with EKS

Contributors

Sangam Biradar