Add on:ingress default port change options

Hi all,
I am using add on ingress , I have requirement to allow to change ingress ports as default ports are not safe to use in production.

i am trying to find out what steps to be followed for add on ingress port change.

and also is it possible to have port per each backend service ?

any recommendations for the above two are would be great help.

Hi @srinijalagam

You should be able to change the port by editing the respective manifest after enabling the ingress addon:

microk8s kubectl edit -n  ingress daemonset.apps/nginx-ingress-microk8s-controller

If I understand correctly what you need, you may want to have multiple ingress controllers for this [1].

[1] Multiple Ingress controllers - Ingress-Nginx Controller

thank you @kjackal for your recommendations, I have tried kubectl edit it works great.

I have tried to below as patch
kubectl patch -n ingress daemonset.apps/nginx-ingress-microk8s-controller -p ‘{“apiVersion”:“apps/v1”,“kind”:“DaemonSet”,“spec”:{“spec”:{“containers”:[{“name”:“nginx-ingress-microk8s”,“ports”:[{“containerPort”:80,“hostPort”:85,“protocol”:“TCP”},{“containerPort”:443,“hostPort”:445,“protocol”:“TCP”}]}],“hostNetwork”:false}}}’

I do see below
daemonset.apps/nginx-ingress-microk8s-controller patched (no change)

not sure why its not effecting the change , not sure what is it i am missing here