MicroK8s

In a world where Kubernetes is uber popular and app modernization isn’t slowing down, your bound to run into MicroK8s.

https://microk8s.io/

And if you run into MicroK8s at work there’s a good chance that you will be testing production application deployments with it that probably have their own means of exposing and routing services defined.

THAT or you are just tinkering trying to get your hello world page up/working from outside of your MicroK8s cluster. Which is cool too!

Public/Private Cloud Options

Public and private clouds throw in their own loadbalancer options that pair with an ingress controller to route traffic to your services.

  • AWS - ALB, ELB
  • Azure - Application Gateway, LoadBalancer
  • VMware Tanzu - NSX or Avi LB

MetalLB Addon

So, what about MicroK8s? How do we get traffic from the outside world to our app backend services?

Luckily MicroK8s has a pretty slick MetalLB addon. If you’re not familiar with MetalLB, check out the links below to learn more.

To enable, use the command below and replace the IP range with IPs sourced from the subnet for which your MicroK8s host lives. MetalLB will ARP those IPs and one will be assigned as an “external IP” to your existing ingress.

microk8s enable metallb:10.64.140.43-10.64.140.49

Ingress Controllers

Several ingress controller options are available to be used in your MicroK8s cluster if you don’t already have one defined.

Conclusion

Without the MetalLB configuration, your ingress “EXTERNAL-IP” status would remain in a “pending” state.

Hopefully you found this quick take on the MicroK8s MetalLB addon helpful.