Nginx ingress will act as a load balancer for the Kubernetes cluster.

In this section you will install the nginx ingress controller.

Install Ingress controller

Download and install the nginx-ingress controller with the following commands.

# Install Nginx-ingress
$ curl -L <https://github.com/kubernetes/ingress-nginx/releases/download/helm-chart-4.0.6/ingress-nginx-4.0.6.tgz> -o ingress-nginx-4.0.6.tgz
$ tar zxf ingress-nginx-4.0.6.tgz
$ helm install nginx-ingress ./ingress-nginx \\
      --version 4.0.6 \\
      --create-namespace \\
      --namespace ingress-nginx \\
      --set controller.hostNetwork=true \\
      --set rbac.create=true \\
      --set defaultBackend.enabled=true \\
      --set tcp."2222"=hub/ssh-bastion-server:2222 \\
      --set controller.image.tag=v1.0.4 \\
      --set controller.image.digest=null \\
      --set controller.admissionWebhooks.enabled=false \\
      --set controller.resources.limits.cpu=250m \\
      --set controller.resources.limits.memory=200Mi \\
      --set controller.resources.requests.cpu=100m \\
      --set controller.resources.requests.memory=100Mi \\
      --set defaultBackend.resources.limits.cpu=250m \\
      --set defaultBackend.resources.limits.memory=100Mi \\
      --set defaultBackend.resources.requests.cpu=100m \\
      --set defaultBackend.resources.requests.memory=64Mi \\
      --set data.proxy-body-size=10m

Verify installation

Use curl to verify that nginx-ingress is running correctly - A 404 response is correct at this stage.

$ curl http://<PRIMEHUB-IP>

default backend - 404