Network Management

External Network

General

An external network provides IP addresses for pods and LoadBalancer services in a cluster, allowing them to be accessed from outside the Kubernetes cluster.

External networks support planning and managing the networks used by LoadBalancer services and pods in a unified way, and divide the IP ranges used by LoadBalancer services and pods by different network segments. The following 2 types of network segments are supported:
  1. Service external network
    • A service external network is used to allocate the IP addresses used by the services of the LoadBalancer type. LoadBalancer services support accessing services from outside a Kubernetes cluster.
    • To use a service external network, all the control plane nodes must have a NIC with the same name, and an IP address must be configured on each of these NICs.
  2. Pod external network
    • A pod external network is used to allocate the IP addresses of the pod external network. A pod external network supports accessing pod IP addresses from outside a Kubernetes cluster directly.
    • By default, pods use the native Kubernetes container network. The network used by pods can be configured in Workload - Advanced Configuration - Network Settings.
    • To use a pod external network, all the nodes must have a NIC with the same name.

Creating an External Network

In the ZStack Zaku main menu, click Cluster Management > Network Management > External Network. On the External Network page, click Create External Network and the Create External Network page is displayed.

You can refer to the following example to enter the required information:
  • Name: set the name of the external network. Naming rules: the length is limited to 1 to 128 characters, and the input can contain only Chinese characters, English letters, digits and the following 7 characters: "-", "_", ".", "(", ")", ":" and "+".
  • Description: optional. Add the information related to the external network.
  • NIC Name: select the NIC used by the external network. Only the NICs that have the same name on all the control plane nodes and are not used by other external networks can be selected.
    Note: The NIC of an external network must meet the following requirements:
    1. To use a service external network, make sure that all nodes with the control plane role have a NIC with the same name.
    2. To use a pod external network, make sure that all the nodes have a NIC with the same name.
    3. The NIC names of physical machine nodes, VM nodes or nodes with different operating systems can be kept consistent by creating a bond.
  • Network Source: if the platform is integrated with ZStack Cloud 5.2.0 or later, select Local Network or Cloud Network. Local Network is selected by default.
    • Local Network: manually specify the IPv4 netmask and gateway.
    • Cloud Network: select a network from the cloud platform. The external network uses the netmask, gateway, and IPv4 CIDR of the selected network.
  • Cloud Network: when the network source is Cloud Network, select Public Network, Flat Network, or VPC Network. Then click the selection button and select a network with available IPv4 addresses in the selection window.
    Note: After changing the network type, select a network again.
  • IPv4 Netmask: when using a local network, specify the netmask for the external network range, such as 255.255.0.0.
  • IPv4 Gateway: when using a local network, specify the gateway for the external network range, such as 172.20.0.1.
Note:
  • The IPv4 CIDR ranges of different external networks must not overlap. For a local network, the CIDR is determined by the IPv4 netmask and gateway.
  • After creating an external network, go to its details page and add a network segment before using the network.

Managing External Networks

In the ZStack Zaku main menu, click Cluster Management > Network Management > External Network to enter the External Network page.

External networks support the following operations:
Operation Description
Create External Network Create a new external network.
Add Network Segment Add a new IPv4 network segment to the external network. Two types of network segments, service external network and pod external network, can be added.
Note:
  • A service external network cannot be created when there is an abnormal control plane node in the cluster.
  • A pod external network cannot be created when the cluster is scaling or there is an abnormal node in the cluster.
  • When adding a service external network segment, make sure that all nodes with the control plane role have the NIC used by the external network. If a message indicates that a NIC has no IPv4 address configured, enter the IPv4 addresses for the listed nodes in Node NIC Configuration, complete the configuration, and then continue adding the network segment.
  • The IPv4 address of each node NIC must be within the IPv4 CIDR range of the external network. It must not conflict with the gateway, network address, broadcast address, other node IP addresses, occupied addresses, or the IP ranges of existing network segments and the segment being added.
  • To add a pod external network segment under an external network, all the nodes must have the NIC of the external network. The NIC names of physical machine nodes, VM nodes or nodes with different operating systems can be kept consistent by creating a bond.
  • The new network segment must be within the IPv4 CIDR range of the current external network. You can view this range in the external network list or on its details page.
  • A network segment cannot contain the gateway, the broadcast address, the network address or the IP addresses that have been occupied.
  • The IP range of the network segment must not overlap with any network segment already added to the current external network.
  • When using a cloud network, the IP range must be within an available network segment of that network and must not be in use by cloud platform resources. After the segment is added, the platform reserves the IP range on the cloud platform.
External Network Details Go to the external network details page to view basic information, IP usage, and the associated cloud network, and manage the network segments of the external network.
Delete External Network Delete the external network.

External Network Details

External Network Range

On the External Network page, click the name of an external network to enter the external network details page, and click Network Segment to enter the Network Segment tab. On this page, you can view the network segment configuration and the IP usage of the external network, and manage the two types of network segments, service external network and pod external network, in a centralized way, including adding, managing IP ranges, setting the sharing mode and deleting:
Operation Description
Add Network Segment Add a new network segment to the external network. Two types of network segments, service external network and pod external network, are supported.
Note:
  • A service external network cannot be created when there is an abnormal control plane node in the cluster.
  • A pod external network cannot be created when the cluster is scaling or there is an abnormal node in the cluster.
  • A cluster whose network mode is BGP does not support using a pod external network. The pod external network type cannot be selected when a network segment is added for a BGP cluster.
  • When adding a service external network segment, make sure that all nodes with the control plane role have the NIC used by the external network. If a message indicates that a NIC has no IPv4 address configured, enter the IPv4 addresses for the listed nodes in Node NIC Configuration, complete the configuration, and then continue adding the network segment.
  • The IPv4 address of each node NIC must be within the IPv4 CIDR range of the external network. It must not conflict with the gateway, network address, broadcast address, other node IP addresses, occupied addresses, or the IP ranges of existing network segments and the segment being added.
  • To add a pod external network segment under an external network, all the nodes must have the NIC of the external network. The NIC names of physical machine nodes, VM nodes or nodes with different operating systems can be kept consistent by creating a bond.
  • The new network segment must be within the IPv4 CIDR range of the current external network. You can view this range in the external network list or on its details page.
  • A network segment cannot contain the gateway, the broadcast address, the network address or the IP addresses that have been occupied.
  • The IP range of the network segment must not overlap with any network segment already added to the current external network.
  • When using a cloud network, the IP range must be within an available network segment of that network and must not be in use by cloud platform resources. After the segment is added, the platform reserves the IP range on the cloud platform.
Manage IP Range Manage the IP ranges of the network segment, including deleting an existing IP range and adding a new IP range.
Note:
  • The IP ranges of all the network segments under an external network cannot conflict with each other.
  • When using a cloud network, the new IP range must be within an available network segment of that network and must not be in use by cloud platform resources. After the range is added, the platform reserves it on the cloud platform.
  • If an IP address in an IP range is in use, the IP range cannot be deleted.
  • A service external network requires at least one IP range.
Set Sharing Mode Set the sharing mode of the network segment. Currently the following two modes are supported:
  • Global sharing: share the network segment globally, and all the projects are allowed to use this network segment.
  • Specified sharing: share the network segment with the specified projects, and the specified projects are allowed to use this network segment.
Note:
  • Service external network: after the sharing mode of a service external network for a specified project is canceled, the system reallocates IP addresses for the services that use this service external network segment under the project. If the IP addresses are insufficient, some services will have no IP address available. Perform this operation with caution.
  • Pod external network: after the sharing mode is modified, the IP addresses that have been used in the original project are retained until the pods that use the IP addresses are deleted. If the pods are created by a StatefulSet, the IP addresses can be released only after the pods are deleted by reducing the number of the replicas or deleting the StatefulSet.
Delete Network Segment Delete the network segment.
Note: A network segment cannot be deleted when an IP address under it is in use.