Network overview

Updated at:

Alibaba Cloud Container Compute Service (ACS) integrates Kubernetes networking, Virtual Private Cloud (VPC), and Server Load Balancer (SLB) for stable, high-performance container networking. Learn concepts such as the Container Network Interface (CNI), Services, Ingresses, DNS-based Service discovery, and the underlying network infrastructure to design application deployment and network access models.

Common ACS networking features

Category

Feature

Support

References

Network configuration management

IPv4/IPv6 dual stack

Not supported

None

Per-pod network configuration

Supported

Specify vSwitches and security groups for pods

Pod security groups

Supported

Specify vSwitches and security groups for pods

North-south traffic

Pod access to the internet

Supported

Direct internet access to Pods

Supported

LoadBalancer Services

Supported

Use an automatically created CLB Service to expose an application

Ingresses

Supported

ALB Ingress management

Service

Cloud-native applications usually require agile iteration and rapid elasticity, and the lifespan of a single container and its associated network resources is very short. Applications therefore need fixed access addresses and automatic load balancing to achieve rapid business elasticity. ACS uses a Service to provide a fixed access entry for a group of containers and to load balance traffic across the containers. The implementation works as follows:

  • When you create a Service object, ACS assigns a relatively fixed Service IP address.

  • ACS uses the selector field to select a group of containers. This Service IP address and port are load balanced across the IP addresses and ports of the containers in the group.

Service networking supports the following modes to handle access from clients of different sources and types:

  • ClusterIP

    • A ClusterIP Service is used for access between applications inside a cluster. If your application needs to be exposed inside the cluster to serve clients, use a ClusterIP Service to expose it.

    When you create a Service, the default Service type is ClusterIP.
  • LoadBalancer

  • Headless Service

    • A Headless Service is a Service that specifies the clusterIP field in the Service properties as None. With this Service type, the Service has no fixed virtual IP address. When a client accesses the domain name of the Service, DNS returns the IP addresses of all backend Pod instances. The client must use DNS-based load balancing to distribute traffic to the backend.

  • ExternalName

    • An ExternalName Service maps a domain name outside the cluster to a Service inside the cluster. For example, map the domain name of an external database to a Service name inside the cluster. Applications inside the cluster can then access the database directly by using the Service name.

For more information about Service load balancing configuration, see Considerations for configuring a LoadBalancer service.

Ingress

Unlike the Layer 4 load balancing of a Service, an Ingress is the Layer 7 access entry point that exposes Services in an ACS cluster to external access. Use an Ingress resource to configure different Layer 7 forwarding rules. For example, route requests to different Services by domain name or access path to achieve Layer 7 load balancing. For more information, see ALB Ingress management.

image

DNS-based Service discovery

ACS uses DNS to provide Service discovery for applications. For example, a client application can resolve the name of a Service to get its ClusterIP for access. It can also resolve the Pod name of a StatefulSet to get the IP address of the Pod. DNS-based Service discovery decouples the calls between applications in a cluster from IP addresses and deployment environments.

CoreDNS in the cluster automatically converts a Service name into the IP address of that Service, so that the same access entry works in different deployment environments. For more information about how to use and tune the DNS add-on of your cluster, see DNS principles and configuration.

image

Underlying network infrastructure

  • VPC

    A VPC is a custom private network created on Alibaba Cloud. Each VPC is logically isolated from other VPCs. Cloud resources, such as Elastic Compute Service (ECS) instances, ApsaraDB RDS instances, and SLB instances, can be created and managed in a VPC.

    image
  • SLB

    Alibaba Cloud SLB uses a virtual service address to virtualize the added ECS instances into a high-performance, highly available application server pool. Based on forwarding rules, SLB distributes requests from clients to the ECS instances in the server pool. For more information about SLB, see SLB product family.

    By default, SLB checks the health status of the ECS instances in the server pool and automatically isolates ECS instances in an abnormal state. This eliminates the single point of failure (SPOF) of a single ECS instance and improves the overall serving capacity of applications. In addition, SLB can mitigate distributed denial-of-service (DDoS) attacks, which strengthens the protection of applications.

    SLB consists of the following three parts:

    • SLB instance

      An SLB instance is a running load balancer that receives traffic and distributes the traffic to backend servers. To use load balancing, you must create an SLB instance and add at least one listener and two ECS instances.

    • Listener

      A listener checks requests from clients and forwards the requests to backend servers. A listener also performs health checks on backend servers.

    • Backend server

      A group of ECS instances that receive requests from the frontend. ECS instances can be added to the server pool individually, or added and managed in batches by using vServer groups or primary/secondary server groups.