除了 Kubernetes 集群资源、API 和默认 Kubernetes pod 网络之外,GDC 还允许您在 GDC 区域中预配其他网络,并将这些网络与您的网络连接起来。例如,如果使用用户平面功能 (UPF),您可以创建无线接入网 (RAN) 和数据平面网络,每个网络都具有不同的子网,这些子网连接到 UPF pod。
如需详细了解边缘网络资源,请参阅网络。
EdgeNetwork 个蓝图
此蓝图包含多个自定义资源,旨在允许用户在 GDC 区域中预配和配置其他网络,并将其与您的网络连接。例如,您可以创建一个运营、管理和维护 (OAM) 网络和一个信号网络,每个网络都具有不同的多个子网,这些子网连接到网络功能 Pod 的辅助接口。以下资源用于 EdgeNetwork 蓝图:
EdgeNetwork:GDC 可用区中的虚拟专用网。数据包在EdgeNetwork内独立路由。EdgeRouter:GDC 区域中的一种逻辑资源,用于为EdgeNetwork配置 BGP 相关参数。EdgeSubnet:GDC 可用区中的 L2 网域、L3 子网。EdgeSubnet会在网络中创建为具有关联 VLAN ID 的 VLAN。EdgeInterconnectAttachment:在 GDC 区域路由器与您的某个提供商边缘 (PE) 路由器之间配置新的虚拟链路。您可以使用连接将EdgeNetwork资源与网络(例如网络上的虚拟路由和转发 [VRF])相关联。
创建部署时,您可以使用 setters.yaml 文件中的以下参数自定义蓝图:
| 参数 | 说明 |
|---|---|
project-id
|
管理 EdgeNetwork 相关资源的项目的项目 ID。您必须将 Edge 关联到此特定项目 ID。 |
network-name
|
EdgeNetwork 资源的名称。 |
location
|
GDC 区域的 Google Cloud 地区。例如 us-west-1。 |
zone
|
要创建 EdgeNetwork 的 GDC 区域。 |
mtu
|
EdgeNetwork 的 IP 最大传输单元 (MTU)。有效选项介于 1500 和 9000 之间。 |
interconnect-attachment-name |
互连附件的名称。 |
interconnect-attachment-vlanid |
分配给互连连接的已标记 VLAN ID 的软件包。 |
interconnect-attachment-interface-ipv4cidr
|
连接到 EdgeInterconnectAttachment 资源的 EdgeRouter 接口的 IP 地址。 |
interconnect-attachment-bgppeer-ipv4cidr |
BGP 会话的 GDC 区域对等方 IPv4 地址。 |
subnet-name
|
EdgeSubnet 资源的名称。 |
subnet-vlan-id
|
分配给 EdgeSubnet 资源的 VLAN ID。 |
subnet-ipv4cidr
|
EdgeSubnet 资源的 IPv4 子网。无类别域间路由 (CIDR) 中的第一个 IP 地址预留为子网网关。 |
subnet-bgppeer-ipv4cidr
|
对等方 BGP 的 IP 地址。IP 地址必须与 EdgeSubnet 资源位于同一子网中。 |
配置具有两个子网的网络
本部分介绍如何配置包含两个子网的网络。例如,示例网络 ran-network 有两个子网,即 ranaccess-1 和 ranaccess-2。对于北向连接,ran-network 为互连 cbae0a11-5d97-4bd6-8a09-e5133bb541ca 和 a52e2c74-84f2-4a6d-8cd2-7c5b0fc1c031 配置了两个互连连接。
导入 EdgeNetwork 蓝图
- 在导航菜单中,点击蓝图。
- 从下拉菜单中,选择您偏好的编排集群。
- 点击从库中导入。
- 选择蓝图 GDCE EdgeNetwork 设置。
- 点击添加蓝图。
- 在下一页上,为蓝图指定名称。例如,GDCE EdgeNetwork 设置。
- (可选)添加任意标签。
- 点击创建。蓝图会显示在蓝图草稿列表中。
修改蓝图
- 在导航菜单中,依次点击蓝图 > 草稿蓝图。
- 选择要修改的蓝图。系统随即会打开蓝图编辑器。
- 根据您的规范修改资源。
然后,点击保存文件。
提议蓝图
- 在导航菜单中,依次点击蓝图 > 草稿蓝图。系统会显示蓝图编辑器。
- 点击建议。蓝图更新的状态会变为已提议。
批准蓝图
- 在导航菜单中,依次点击蓝图 > 草稿蓝图。
- 点击蓝图名称旁边的操作图标。
- 选择批准。蓝图会显示在已批准的蓝图中。
检索互连信息
如需检索互连信息,请执行以下操作:
设置并导出环境变量:
export networkName=NETWORK_NAME export MACHINES_LOCATION=MACHINE_LOCATION # value where machines or rack is located. Can be different from cluster location. export MACHINES_PROJECT_ID=PROJECT_ID # project in which machines or rack is registered. Can be different from cluster project export EDGE_ZONE=ZONE # Edge zone in which machines or rack is located替换以下内容:
NETWORK_NAME:网络的名称。MACHINE_LOCATION:机器或机架的位置。此值可以与集群位置不同。PROJECT_ID:注册机器或机架的项目。此值可以与集群项目不同。ZONE:机器或机架所在的边缘可用区。
检索互连信息:
gcloud alpha edge-cloud networking interconnects list --zone=$EDGE_ZONE --location=$MACHINES_LOCATION --project=$MACHINES_PROJECT_ID输出类似于以下内容:记下互连的名称和物理端口,以便应用于与网络的互连连接。
NAME UUID DEVICECLOUDRESOURCENAME PHYSICALPORTS cbae0a11-5d97-4bd6-8a09-e5133bb541ca cbae0a11-5d97-4bd6-8a09-e5133bb541ca projects/81907970660/locations/us-central1-edge-den8/switches/et19.den97 HundredGigE0/0/0/0,HundredGigE0/0/0/23 a52e2c74-84f2-4a6d-8cd2-7c5b0fc1c031 a52e2c74-84f2-4a6d-8cd2-7c5b0fc1c031 projects/81907970660/locations/us-central1-edge-den8/switches/et19.den97 HundredGigE0/0/0/1,HundredGigE0/0/0/22 37e5da97-1a3f-4935-9d9b-0a8cea589644 37e5da97-1a3f-4935-9d9b-0a8cea589644 projects/81907970660/locations/us-central1-edge-den8/switches/et20.den97 HundredGigE0/0/0/0,HundredGigE0/0/0/23 71b54ef5-6b12-4b03-b8ce-eb88196f8a93 71b54ef5-6b12-4b03-b8ce-eb88196f8a93 projects/81907970660/locations/us-central1-edge-den8/switches/et20.den97 HundredGigE0/0/0/1,HundredGigE0/0/0/22
EdgeNetwork 部署
创建 EdgeNetwork 部署
- 在导航菜单中,依次点击蓝图 > 已获批的蓝图。
- 点击要部署的
EdgeNetwork蓝图。 - 点击创建部署。
- 为部署提供名称。
- 点击创建部署。相应部署会显示在草稿部署中。
修改 EdgeNetwork 部署
- 在导航菜单中,点击蓝图。
- 点击要修改的蓝图
EdgeNetwork。系统会显示部署编辑器。 修改
setters.yaml文件。如需详细了解文件中的每个字段,请参阅EdgeNetwork蓝图。以下示例setters.yaml文件展示了完整的配置:apiVersion: v1 kind: ConfigMap metadata: # kpt-merge: /setters name: setters annotations: config.kubernetes.io/local-config: "true" internal.kpt.dev/upstream-identifier:'|ConfigMap|default|setters' data: # The project managing the GDC Edge machines. project-id: tna-testing-01 # Name of the network network-name: ranprod # Location in which to create the resources location: us-central1 # Zone to create in the resources zone: us-central1-edge-den8 # Details of subnets for southbound peering # Details of subnet 1 # Name of the subnet subnet1-name: ranaccess-prod1 # vlanId for the subnet subnet1-vlanid: 2142 # ipv4cidr for the subnet subnet1-ipv4cidr: 10.142.0.0/24 # ipv4cidr for the subnet bgppeer subnet1-bgppeer-ipv4cidr: 10.142.0.0/24 # Details of subnets for southbound peering # Details of subnet 1 # Name of the subnet subnet2-name: ranaccess-prod2 # vlanId for the subnet subnet2-vlanid: 2132 # ipv4cidr for the subnet subnet2-ipv4cidr: 10.132.0.0/24 # ipv4cidr for the subnet bgppeer subnet2-bgppeer-ipv4cidr: 10.132.0.0/24 # Interconnect attachments for northbound peering # Details of interconnect attachment 1 # Name of the interconnect interconnect1-name: cbae0a11-5d97-4bd6-8a09-e5133bb541ca # Name of the interconnect attachment interconnect1-attachment-name: prod1-ran # valnId of the interconnect attachment interconnect1-attachment-vlanid: 2010 # ip4vcidr for the interconnect attachment interface interconnect1-attachment-interface-ipv4cidr:10.65.128.17/31 # ipv4cidr for the interconnect attachment bgppeer interconnect1-attachment-bgppeer-ipv4cidr: 10.65.128.16/31 # Interconnect attachments for northbound peering # Details of interconnect attachment 1 # Name of the interconnect interconnect2-name: a52e2c74-84f2-4a6d-8cd2-7c5b0fc1c031 # Name of the interconnect attachment interconnect2-attachment-name: prod2-ran # valnId of the interconnect attachment interconnect2-attachment-vlanid: 2020 # ip4vcidr for the interconnect attachment interface Interconnect2-attachment-interface-ipv4cidr:10.65.128.13/31 # ipv4cidr for the interconnect attachment bgppeer interconnect2-attachment-bgppeer-ipv4cidr: 10.65.128.12/31然后,点击保存文件。
应用 EdgeNetwork 部署
- 在导航菜单中,点击部署。
- 选择要应用的
EdgeNetwork部署。 - 点击部署。
- 确认部署。相应部署会显示在已应用的部署中。
验证 EdgeNetwork 蓝图
如需验证 EdgeNetwork 资源的创建状态,请执行以下操作:
kubectl
为编排集群生成
kube-credentials以使用kubectlCLI:gcloud anthos config controller get-credentials ORCHESTRATION_CLUSTER_NAME将 ORCHESTRATION_CLUSTER_NAME 替换为编排集群的名称。
等待 30 到 40 分钟,让资源完成处理。
查看资源的状态:
kubectl describe EdgeNetwork ${networkName} --namespace=tna-config-control输出类似于以下内容:请注意
status.conditions中的message和reason。Name: ranprod Namespace: tna-config-control .... API Version: config.cloud.google.com/v1alpha1 Kind: EdgeNetwork .... Spec: Mtu: 9000 Network Location: us-central1 Network Zone: us-central1-edge-den8 Status: Conditions: Last Transition Time: 2023-03-23T10:08:40Z Message: The resource is up to date Reason: UpToDate Status: True Type: Ready Create Time: 2023-03-23T10:08:36.582479587Z Self Link: //gkehub.googleapis.com/v1/projects/tna-testing-01/locations/us-central1/zone s/us-central1-edge-den8/networks/ranprod Update Time: 2023-03-23T10:08:40.010036655Z Events: <none>获取所创建的 Edge 路由器的信息:
kubectl describe EdgeRouter router-${networkName} --namespace=tna-config-control输出类似于以下内容:
Name: router-ranprod Namespace: tna-config-control ... API Version: config.cloud.google.com/v1alpha1 Kind: EdgeRouter .... Spec: ..... Network: External: projects/tna-testing-01/locations/us-central1/zones/us-central1-edge-den8/net works/ranprod Object Ref: API Group: Kind: Name: Namespace: Router Location: us-central1 Router Zone: us-central1-edge-den8 Status: Bgp Peer: Interface: inf-ranaccess-prod1 Name: 2142-bgp0 Peer Asn: 3300 peerIpv4Cidr: 10.142.0.0/24 Interface: inf-ranaccess-prod2 Name: 2132-bgp0 Peer Asn: 3300 peerIpv4Cidr: 10.132.0.0/24 Interface: vlan-2010-prod1-ran interfaceIpv4Cidr: 10.65.128.17/31 Name: vlan-2010-bgp0 Peer Asn: 577 peerIpv4Cidr: 10.65.128.16/31 Interface: vlan-2020-prod2-ran interfaceIpv4Cidr: 10.65.128.13/31 Name: vlan-2020-bgp1 Peer Asn: 577 peerIpv4Cidr: 10.65.128.12/31 Conditions: Last Transition Time: 2023-03-23T10:47:12Z Message: The resource is up to date Reason: UpToDate Status: True Type: Ready Create Time: 2023-03-23T10:08:38.995964419Z Interface: Name: inf-ranaccess-prod1 Subnetwork: API Group: config.cloud.google.com Kind: EdgeSubnet Name: ranaccess-prod1 Namespace: tna-config-control Name: inf-ranaccess-prod2 Subnetwork: API Group: config.cloud.google.com Kind: EdgeSubnet Name: ranaccess-prod2 Namespace: tna-config-control ipv4Cidr: 10.65.128.17/31 Linked Interconnect Attachment: API Group: config.cloud.google.com Kind: EdgeInterconnectAttachment Name: prod1-ran Namespace: tna-config-control Name: vlan-2010-prod1-ran ipv4Cidr: 10.65.128.13/31 Linked Interconnect Attachment: API Group: config.cloud.google.com Kind: EdgeInterconnectAttachment Name: prod2-ran Namespace: tna-config-control Name: vlan-2020-prod2-ran Self Link: //gkehub.googleapis.com/v1/projects/tna-testing-01/locations/us-central1/zone s/us-central1-edge-den8/routers/router-ranprod State: STATE_RUNNING Update Time: 2023-03-23T10:36:58.126306756Z Events: <none>
gcloud
获取所创建的 Edge 路由器的信息:
gcloud edge-cloud networking routers describe router-${networkName} \ --zone=$EDGE_ZONE \ --location=$LOCATION \ --project=GDCE_MACHINES_PROJECT将
GDCE_MACHINES_PROJECT替换为注册 GDC 机器的项目 ID。如需为用户平面功能 (UPF) 配置网络,请针对每个网络重复此步骤。
删除 EdgeNetwork 部署
- 在导航菜单中,依次点击部署 > 已应用的部署。
- 选择要删除的
EdgeNetwork蓝图。 - 点击删除。
- 确认删除。
- 等待 30 至 45 分钟,让系统处理删除操作。
- 为确保您已删除资源,请重复修改
EdgeNetwork部署中的步骤。