Configuring Ingress to expose Services outside the cluster
As we discussed in the Overview of MetalLB and Ingress section, Ingress offers HTTP and HTTPS routes to Services within the cluster from outside the cluster. Rules defined on Ingress control traffic routing. NGINX Ingress Controller is a common Kubernetes Ingress and the default Ingress controller for MicroK8s as well.
Another option is employing a load balancer such as MetalLB that can be deployed in the same Kubernetes cluster, and the Services can then be exposed to an external network.
A diagrammatic illustration of both approaches is shown here:
Figure 7.20 – Ingress load-balancing functionality
Both options are discussed in more depth in the following sections.
Option 1 – Using the Ingress NodePort method
For this option and the next, we'll use the same MicroK8s Raspberry Pi cluster that we built for the MetalLB setup.