How to avoid/control creation of default security group rule when creating kubernetes LoadBalancer service in Azure?

10/30/2019

Whenever I create Nginx ingress controller with kubernetes service of type LoadBalancer, it adds rules 500/501 the LoadBalancer security group that opens 80 and 443 to internet.

Is there a way to prevent this or change these rules?

-- ThatChrisGuy
azure
kubernetes

1 Answer

10/31/2019

The ports 80 and 443 are the default ports used by the Nginx ingress, it was set in the values.yaml file of the nginx ingress charts. Generally, port 80 is for HTTP and the 443 for https. But if you want to change them as you want, you can set them when you install them via the helm like this:

--set controller.service.ports.http=8081 \
--set controller.service.ports.https=8082 \

The result shows here:

enter image description here

You can download the Nginx ingress charts and read the setting in it. Then you can change the setting as you want with the format above.

-- Charles Xu
Source: StackOverflow