Enable AWS Network Load Balancer on a microK8s cloud using Juju?

MicroK8s does not, on its own, support auto-provisioning of cloud load balancers. Juju has the aws-integrator charm. In a microk8s-exclusive cloud cluster on AWS, can I use Juju to grant MicroK8s nodes the ability to auto-provision a Network Load Balancer/Application Load Balancer/Elastic Load Balancer?

Probably not possible with Juju but I’ll let someone else answer that.

You could try using the AWS CLI tools:

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/tutorial-application-load-balancer-cli.html
https://docs.aws.amazon.com/elasticloadbalancing/latest/network/network-load-balancer-cli.html

I actually wrote some Terraform HCL to bring up the NLB on AWS but I’d prefer a Canonical product solution. I am curious what I would need in addition to my MicroK8s nodes to make use of the aws-integrator charm: kubernetes-core?

I believe if you want this type of integration, you’ll have to shift from microk8s to using full CDK on top of AWS (such as the kubernetes-core bundle) in order to gain the advantages of the juju relations between kubernetes-master, kubernetes-worker, and aws-integrator.

If you are talking about having Kubrernetes create AWS LBs for your K8s services, all you should need to do is to deploy the cloud-provider-aws in your microk8s cluster, and add the --cloud-provider=external flag to $SNAP_DATA/args/{kubelet,kube-apiserver,kube-controller-manager} files per the MicroK8s - Configuring Services docs. You will also need to make sure the microk8s node instances have the proper IAM permissions as mentioned in the cloud-provider-aws README.

I’m not sure how you’re managing your microk8s cluster instances or where Juju would come into play with helping automate that, but that’s essentially what the AWS Integrator + CK do via the charms (with the one caveat the CK is still using the in-tree AWS cloud provider, rather than the external one, but the plan is to switch).

I have not tested this at all and don’t know if there are any potential gotchas due to the snap confinement of microk8s, but it doesn’t seem like there should be since it should just be network traffic.

2 Likes