Updated on 2024-03-04 GMT+08:00

Cluster Overview

Kubernetes is a containerized application software system that can be easily deployed and managed. It facilitates container scheduling and orchestration.

For application developers, Kubernetes can be regarded as a cluster operating system. Kubernetes provides functions such as service discovery, scaling, load balancing, self-healing, and even leader election, freeing developers from infrastructure-related configurations.

When using Kubernetes, it is like you run a large number of servers as one on which your applications run. Regardless of the number of servers in a Kubernetes cluster, the method for deploying applications in Kubernetes is always the same.

Kubernetes Cluster Architecture

A Kubernetes cluster consists of master nodes (Masters) and worker nodes (Nodes). Applications are deployed on worker nodes, and you can specify the nodes for deployment.

For CCE clusters, master nodes are hosted by CCE. You only need to create worker nodes.

The following figure shows the architecture of a Kubernetes cluster.

Figure 1 Kubernetes cluster architecture

Master node

A master node is the machine where the control plane components run, including API server, scheduler, controller manager, and etcd.

  • API server: a transit station for components to communicate with each other. It receives external requests and writes data into etcd.
  • Controller manager: carries out cluster-level functions, such as component replication, node tracing, and node fault fixing.
  • Scheduler: schedules containers to nodes based on various conditions (such as available resources and node affinity).
  • etcd: provides distributed data storage for cluster configurations.

In a production environment, multiple master nodes are deployed to ensure high cluster availability. For example, you can deploy three master nodes for your CCE cluster.

Worker node

A worker node is a compute node for running containerized applications in a cluster. A worker node consists of the following components:

  • kubelet: communicates with the container runtime, interacts with the API server, and manages containers on the node.
  • kube-proxy: an access proxy between application components.
  • Container runtime: an engine such as Docker software for downloading images and running containers.

Number of Master Nodes and Cluster Scale

When you create a cluster on CCE, the number of master nodes can be set to 1 or 3. Three master nodes can be deployed to create a cluster in HA mode.

The master node specifications determine the number of nodes that can be managed by a cluster. When creating a cluster, you can select the cluster management scale, for example, 50 or 200 nodes.

Cluster Network

From the perspective of the network, all nodes in a cluster are located in a VPC, and containers are running on the nodes. You need to configure node-node, node-container, and container-container communication.

A cluster network can be divided into three network types:

  • Node network: IP addresses are assigned to nodes in a cluster.
  • Container network: IP addresses are assigned to containers in a cluster for communication between them. Currently, multiple container network models are supported, and each model has its own working mechanism.
  • Service network: A service is a Kubernetes object used to access containers. Each Service has a fixed IP address.

When you create a cluster, select a proper CIDR block for each network to ensure that the CIDR blocks do not conflict with each other and each CIDR block has sufficient available IP addresses. After a cluster is created, the container network model cannot be modified. Plan the container network model properly before creating a cluster.

You are advised to learn about the cluster network and container network models before creating a cluster. For details, see Overview.

Cluster Lifecycle

Table 1 Cluster status

Status

Description

Creating

A cluster is being created and is requesting for cloud resources.

Normal

A cluster is running properly.

Scaling-out

A node is being added to a cluster.

Scaling-in

A node is being deleted from a cluster.

Hibernating

A cluster is hibernating.

Awaking

A cluster is being woken up.

Upgrading

A cluster is being upgraded.

Unavailable

A cluster is unavailable.

Deleting

A cluster is being deleted.

Figure 2 Cluster status transition