By Sirinat Paphatsirinatthi, Guest Author
Alibaba Cloud Container Service for Kubernetes (ACK) is a Kubernetes service provided by Alibaba Cloud to support large scale architecture like microservices or event driven architecture. Containers in a cluster can communicate each other in the same Kubernetes namespaces or other namespaces, which the backend behind this is the Container Network Interface (CNI).
In the first article of this series, we will try to better understand the characteristics of different CNI models in an ACK cluster. Let’s begin!
Terway is a container network that leverage elastic network interfaces (ENIs) or a vSwitchs to allocate pod IPs and manage container communications.
Terway provides the following features:
Flannel provides the following features:
Now, we have learned about the different CNI models, let's discuss about how you can decide on which CNI to choose from. Terway is a container network that can allocate pod IPs from vSwitchs, but Flannel has its own network CIDR block, therefore CIDR block of pods will not overlap with the cluster VPC.
Generally speaking, Terway would be the preferred choice for most applications. Terway allows you to use standard Kubernetes network policies to regulate how containers communicate with each other. In addition, Terway is compatible with Calico network polices.
Table 1: Terway vs. Flannel
What's more, if you select the Terway network plug-in when you create a cluster, you can choose to enable the Terway IPvlan mode. Compared with the default Terway mode, the Terway IPvlan mode optimizes the performance of pod networks, Service networks, and network policies.
If you do not want to use network policies, you can select Flannel as the network plug-in. However, Flannel only provides basic features and does not support standard Kubernetes network policies.
For a detailed introduction on using the Terway plug-in on Alibaba Cloud, please refer to the official documentation at: https://www.alibabacloud.com/help/doc-detail/97467.htm
I hope that this blog helped you understand the differences between Flannel and Terway, the two CNI models in Alibaba Cloud Container Service for Kubernetes (ACK). If you want to learn more about the inner workings of Kubernetes networks, I suggest checking out this blog by Alibaba Cloud, From Confused to Proficient: Details of the Kubernetes Cluster Network.
In the next section, we’re going to learn about ACK ECS types comparisons.
Sirinat Paphatsirinatthi is a CNCF Certified Kubernetes Application Developer / Administrator experienced in cloud native and container based architecture design for scalability and high availability. He has helped the leading bank of Thailand to adopt Kubernetes through DevSecOps good practices (Develop Fast, Deploy Fast, Learn Fast) which everyone will collaborate in one cross functional team (Develop, DevOps, Test).
Disclaimer: The views expressed herein are for reference only and don't necessarily represent the official views of Alibaba Cloud.
Alibaba Developer - June 22, 2020
Alibaba System Software - August 27, 2018
OpenAnolis - October 26, 2022
Alibaba Cloud Native - June 7, 2023
Alibaba Developer - May 31, 2021
Alibaba Developer - September 7, 2020
Alibaba Cloud Container Service for Kubernetes is a fully managed cloud container management service that supports native Kubernetes and integrates with other Alibaba Cloud products.Learn More
Accelerate software development and delivery by integrating DevOps with the cloudLearn More
Provides a control plane to allow users to manage Kubernetes clusters that run based on different infrastructure resourcesLearn More
Accelerate and secure the development, deployment, and management of containerized applications cost-effectively.Learn More
More Posts by Alibaba Clouder