Rate This Document
Findability
Accuracy
Completeness
Readability

Component Principles

Kubernetes

Kubernetes is an open-source container cluster deployment and management system, and has become a de facto standard in the PaaS field. Kubernetes is developed based on container technology and provides functions like resource scheduling, deployment, execution, service discovery, and capacity expansion and reduction for containerized applications. Kubernetes is the scheduling platform indeed, which is based on container technologies. Figure 1 shows the architecture.

Kubernetes provides the following functions:

  • Supports container-based application deployment, maintenance, and rolling upgrade.
  • Supports load balancing and service discovery.
  • Supports cluster scheduling cross different machines and areas.
  • Supports auto scaling.
  • Supports stateless and stateful services.
  • Supports a wide range of volumes.
  • Ensures plug-in mechanism scalability.

Kubernetes develops rapidly and has become a leader in the field of container orchestration.

Figure 1 Kubernetes component architecture

Docker

A Docker container is a process on the host OS. Docker uses namespaces and Cgroups to isolate and restrict resources. Namespaces in the Linux kernel are used to implement lightweight virtualization services. Processes in the same namespace can sense the changes of each other but are unaware of external processes. Users, hostnames, domain names, semaphores, networks, file systems, and processes in the same namespaces can be isolated. Cgroups can limit and record physical resources (including CPU, memory, and I/O resources) used by task groups to provide a basis for container virtualization. Cgroups provides the following functions:

  • Resource limit: Cgroups can limit the total amount of resources used by tasks. For example, the upper limit of the memory used during running can be set.
  • Priority allocation: controls the allocation of resource priorities based on the allocated CPU time slice and I/O bandwidth.
  • Resource statistics: Cgroups can collect statistics on system resource usage such as CPU usage duration and memory usage.
  • Task control: Cgroups can suspend and resume tasks.
Figure 2 Docker container architecture

Docker uses the typical C-S architecture. A user uses a Docker client to communicate with a Docker daemon and sends a request to the Docker daemon. The Docker client is used to send a request to the Docker daemon and perform container management operations. It can be a Docker command line tool or a Docker API client. The Docker daemon is the core Docker background process. It responds to requests from the Docker client and translates these requests into system calls to complete container management operations. The Docker image management module is Image Management. It downloads images from the Docker Registry and stores the images in the file system. The Docker network can be a host physical network, virtual bridge network, or overlay network.