13.2.3. 准备 Microsoft Azure 以部署 Submariner


要准备 Microsoft Azure 上的集群来部署 Submariner 组件,请完成以下步骤:

  1. 在 Microsoft Azure 上创建入站和出站防火墙规则以打开 IP security IKE(默认为 500/UDP)和 NAT 遍历端口(默认为 4500/UDP),以启用 Submariner 通讯:

    # create inbound nat rule
    $ az network lb inbound-nat-rule create --lb-name <lb-name> \
    --resource-group <res-group> \
    --name <name> \
    --protocol Udp --frontend-port <ipsec-port> \
    --backend-port <ipsec-port> \
    --frontend-ip-name <frontend-ip-name>
    
    # add your vm network interface to the created inbound nat rule
    $ az network nic ip-config inbound-nat-rule add \
    --lb-name <lb-name> --resource-group <res-group> \
    --inbound-nat-rule <nat-name> \
    --nic-name <nic-name> --ip-config-name <pipConfig>

    lb-name 替换为您的负载均衡器的名称。

    res-group 替换为您的资源组的名称。

    nat-name 替换为您的负载均衡 NAT 规则的名称。

    使用您的 IPsec 端口替换 ipsec-port

    pipConfig 替换为集群前端 IP 配置名称。

    nic-name 替换为您的网卡(NIC)。

  2. 创建一个负载均衡入站 NAT 规则以转发 Submariner 网关指标服务请求:

    # create inbound nat rule
    $ az network lb inbound-nat-rule create --lb-name <lb-name> \
    --resource-group <res-group> \
    --name <name> \
    --protocol Tcp --frontend-port 8080 --backend-port 8080 \
    --frontend-ip-name <frontend-ip-name>
    
    # add your vm network interface to the created inbound nat rule
    $ az network nic ip-config inbound-nat-rule add \
    --lb-name <lb-name> --resource-group <res-group> \
    --inbound-nat-rule <nat-name> \
    --nic-name <nic-name> --ip-config-name <pipConfig>

    lb-name 替换为您的负载均衡器的名称。

    res-group 替换为您的资源组的名称。

    nat-name 替换为您的负载均衡 NAT 规则的名称。

    pipConfig 替换为集群前端 IP 配置名称。

    nic-name 替换为您的网卡(NIC)。

  3. 在 Azure 上创建网络安全组 {NSG)安全规则,为 Submariner 打开 IPsec IKE(默认为 500/UDP)和 NAT 遍历端口(默认为 4500/UDP):

    $ az network nsg rule create --resource-group <res-group> \
    --nsg-name <nsg-name> --priority <priority> \
    --name <name> --direction Inbound --access Allow \
    --protocol Udp --destination-port-ranges <ipsec-port>
    
    $ az network nsg rule create --resource-group <res-group> \
    --nsg-name <nsg-name> --priority <priority> \
    --name <name> --direction Outbound --access Allow \
    --protocol Udp --destination-port-ranges <ipsec-port>

    res-group 替换为您的资源组的名称。

    nsg-name 替换为您的 NSG 名称。

    priority 替换为您的规则优先级。

    使用您的规则名称替换 name

    使用您的 IPsec 端口替换 ipsec-port

  4. 创建 NSG 规则以打开 4800/UDP 端口,将来自 worker 和 master 节点的 pod 流量封装到 Submariner 网关节点:

    $ az network nsg rule create --resource-group <res-group> \
    --nsg-name <nsg-name> --priority <priority> \
    --name <name> --direction Inbound --access Allow \
    --protocol Udp --destination-port-ranges 4800 \
    
    $ az network nsg rule create --resource-group <res-group> \
    --nsg-name <nsg-name> --priority <priority> \
    --name <name> --direction Outbound --access Allow \
    --protocol Udp --destination-port-ranges 4800

    res-group 替换为您的资源组的名称。

    nsg-name 替换为您的 NSG 名称。

    priority 替换为您的规则优先级。

    使用您的规则名称替换 name

  5. 创建 NSG 规则以打开 8080/TCP 端口,从 Submariner Gateway 节点导出指标服务:

    $ az network nsg rule create --resource-group <res-group> \
    --nsg-name <nsg-name> --priority <priority> \
    --name <name> --direction Inbound --access Allow \
    --protocol Tcp --destination-port-ranges 8080 \
    
    $ az network nsg rule create --resource-group <res-group> \
    --nsg-name <nsg-name> --priority <priority> \
    --name <name> --direction Outbound --access Allow \
    --protocol Udp --destination-port-ranges 8080

    res-group 替换为您的资源组的名称。

    nsg-name 替换为您的 NSG 名称。

    priority 替换为您的规则优先级。

    使用您的规则名称替换 name

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部