Nginx Ingress

In this section, we will deploy Nginx Ingress and then integrate it with vngcloud-controller-manager plugin. Deploy the Nginx Ingress controller by applying the following nginx-ingress.yaml file:

kubectl apply -f nginx-ingress.yaml

Verify Nginx ingress is running:

kubectl get pods -owide -n ingress-nginx

Check the NGINX Ingress controller has been assigned a public Ip address (waiting about 5 mins):

Access to this IP address will show you the NGINX 404 page. This is because we have not set up any routing rules for our services yet.

  • Set up a basic web app for testing our new Ingress controller.
kubectl create ingress demo --class=nginx --rule vks.vngcloud.vn/=demo:80

  • Set up two more web apps. Now we will set up two more web apps, and route traffic between them using NGINX, file app-1.yaml and app-2.yaml
kubectl apply -f app-1.yaml -n ingress-nginx
kubectl apply -f app-2.yaml -n ingress-nginx

Check the new pods are running (you should see two aks-helloworld pods running):

kubectl get pods -owide -n ingress-nginx

Setup the Ingress to route traffic between the two apps, file hello-world-ingress.yaml:

kubectl apply -f hello-world-ingress.yaml -n ingress-nginx

Browse to the <EXTERNAL_IP>/hello-world-one and <EXTERNAL_IP>/hello-world-two:

From the UI: