microk8s ingress

Install

Install microk8s and nginx ingress.

sudo snap install microk8s --classic
sudo microk8s status --wait
sudo microk8s enable ingress

Note that the nginx ingressClassName provided by microk8s is public.

Configure

Increase proxy buffer size, enable header underscores, enable use-forwarded-headers.

microk8s kubectl -n ingress edit configmaps nginx-load-balancer-microk8s-conf

add the following

data:
  use-forwarded-headers: "true"
  enable-underscores-in-headers: "true"
  proxy-buffer-size: "16k"

Rollout the changes

microk8s kubectl -n ingress rollout restart daemonset nginx-ingress-microk8s-controller