13.2.3. 准备 Microsoft Azure 以部署 Submariner
要准备 Microsoft Azure 上的集群来部署 Submariner 组件,请完成以下步骤:
在 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)。创建一个负载均衡入站 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)。在 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。创建 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。创建 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。