简体   繁体   English

在 Azure 中创建 kubernetes LoadBalancer 服务时,如何避免/控制默认安全组规则的创建?

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

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.每当我使用 LoadBalancer 类型的 kubernetes 服务创建 Nginx 入口 controller 时,它都会向 Internet 安全组添加打开 LoadBalancer 安全组的规则 500/501 和 4。

Is there a way to prevent this or change these rules?有没有办法防止这种情况或改变这些规则?

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.端口 80 和 443 是 Nginx 入口使用的默认端口,它在 nginx 入口图表的 values.yaml 文件中设置。 Generally, port 80 is for HTTP and the 443 for https.通常,端口 80 用于 HTTP,443 用于 https。 But if you want to change them as you want, you can set them when you install them via the helm like this:但是,如果您想根据需要更改它们,可以在通过 helm 安装它们时设置它们,如下所示:

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

The result shows here:结果显示在这里:

在此处输入图像描述

You can download the Nginx ingress charts and read the setting in it.您可以下载 Nginx 入口图表并阅读其中的设置。 Then you can change the setting as you want with the format above.然后,您可以根据需要使用上述格式更改设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM