Table of contents
1. Terway Network IntroductionTerway is an open-source CNI (Container Network Interface) plug-in based on the private network VPC developed by Alibaba Cloud. It supports defining access policies between containers based on Kubernetes standard network policies. You can use the Terway network plug-in to achieve network interconnection within the Kubernetes cluster. The Terway network plug-in assigns native elastic network cards to Pods to implement Pod networks. It supports network policies based on Kubernetes standards to define access policies between containers and is compatible with Calico network policies. In the Terway network plug-in, each Pod has its own network stack and IP address. Communication between Pods in the same ECS is directly forwarded through the internal forwarding of the machine. For Pods across ECSs, messages are directly forwarded through the elastic network card of the VPC. Since there is no need to use tunneling technologies such as VxLAN to encapsulate messages, the Terway mode network has higher communication performance. In a word, the biggest feature of Terway is that it uses the characteristics of the ECS server on the cloud to level the network of pods and nodes, and uses the IP address in the vSwitch under VPC. 2. Problem phenomenonDue to the use of the Terway network mode, as the number of node machines and pods increases, each allocated IP address will consume the available IP addresses of the vswitch under the vpc. If the business grows rapidly in a short period of time, causing a large number of available IP addresses to be consumed by pods, then there may be insufficient available IP addresses of the vSwitch due to insufficient early planning. At this time, the status of the newly created pod is ContainerCreating. When you describe the pod, the prompt "error allocate ip..." appears. At this time, check the Terway log of the node where the Pod is located, and you will see the following content:
If there are not enough IP addresses, it means that the switch IP address is insufficient. You can log in to the switch console to view the number of available IP addresses of the switch where the node is located. If there are very few or even 0 IP addresses, it means that capacity expansion is required. 3. Capacity expansion operation3.1 Add a switch and configure NAT Create a new vSwitch in the VPC corresponding to the private network management console. The vSwitch must be in the same region as the vSwitch with insufficient IP resources. This is because the strategy of Terway when assigning pod IPs is to assign the IP corresponding to the vSwitch in the availability zone where the node is located. Therefore, capacity expansion requires the expansion of the switch in the same availability zone. This should be considered when initializing a new switch in the cluster and when expanding the switch capacity. As the density of Pods increases, in order to meet the growing demand for IP addresses from Pods, it is recommended that the network bits of the vSwitch created for Pods be less than or equal to 19, that is, each network segment contains at least 8192 available IP addresses. After the vSwitch is created, you need to configure a NAT policy for the vSwitch to access the external network. 3.2 Configuring Terway for Cluster Configure the cluster's Terway and add the vSwitch created above to the Terway's ConfigMap configuration.
For configuration examples, refer to Terway Configuration Reference [1]. Some of the contents are described as follows:
In the above configuration parameters, the configuration value of the resource pool water level. Terway uses the underlying network resources of the underlying virtualization to connect the container network. The creation and release of network resources require a series of API calls. Frequent API calls during Pod creation and destruction will result in a long Pod configuration time. Terway caches resources in a pooled manner. When the water level is less than the minimum water level of the resource pool, resources are automatically replenished. When the water level is greater than the maximum water level of the resource pool, resources are released. This ensures efficient resource utilization and allocation efficiency. This is equivalent to pre-allocating an IP address. The specific settings can be flexibly set based on the maximum number of ENI auxiliary network cards and the maximum number of pods supported by the machine node specifications. 3.3 Restart terway Restart all Terway pods to quickly refresh the cache and take effect.
After restarting, check whether the abnormal pod has obtained the IP normally. When troubleshooting issues related to IP allocation for a pod, you can also enter the Terway pod of the node and execute the command line to view the currently allocated IP addresses and the temporarily idle IP addresses that have been allocated from the vSwitch.
See you ~ References [1]Terway configuration reference: https://github.com/AliyunContainerService/terway/blob/main/docs/dynamic-config.md This article is reprinted from the WeChat public account "Xianren Technology", which can be followed through the following QR code. To reprint this article, please contact the Xianren Technology public account. |
<<: What are the 5G scenarios in digital transformation?
>>: Custom Traefik (local) plugins
What is WebSocket WebSocket is a protocol based o...
Today we will look at the basic configuration cas...
Today, at the China (Beijing) International Infor...
[[431728]] 【51CTO.com Quick Translation】 Today, t...
In the past, when we were on an airplane, the fli...
[[433205]] Suppose you are climbing a staircase. ...
[[341641]] This article is reprinted from the WeC...
[[415987]] The well-known research organization A...
We’ve all heard the predictions that the Internet...
A total of more than 700,000 5G base stations hav...
Sharktech is a long-established foreign hosting c...
The Ministry of Industry and Information Technolo...
[51CTO.com original article] On March 21, Huawei ...
[[374759]] This article is reprinted from the WeC...
With the development of 5G technology, more and m...