1 Virtualization technology V.S. container technology

1.1 Virtualization Technology

Virtualization technology enables users to create multiple simulated environments or dedicated resources within a single physical hardware system. The hypervisor connects directly to the hardware to divide a system into separate, separate security environments, known as virtual machines. The hypervisor’s ability to separate computer resources from hardware and allocate them appropriately is important for virtual machines.

A host is physical hardware equipped with a Hypervisor. VMS that use its resources are called virtual clients. VMS virtualize physical resources using a Hypervisor. These virtual clients treat computing resources (such as CPU, memory, and storage) as a set of resources that can be reallocated and can control virtual instances of CPU, memory, storage, and other resources so that virtual clients can receive the resources they need when they need them.

Multiple application processes can be deployed on a physical machine, and each application runs independently on a VM.

Advantages:

  1. Pooling physical resources: Resources on a dedicated server can be allocated to different VMS.
  2. Easy to scale: You can create multiple hosts or virtual machines.
  3. Easy to cloud: Do not need to pay attention to physical resources, you can use AWS, Ali Cloud directly to create VMS.

Disadvantages:

  1. High resource usage: Each VM is a complete OPERATING system (OS) and resources need to be allocated. As the number of VMS increases, the OS consumes more resources.
  2. There are many redundant steps

1.2 Container Technology

Development and O&M challenges: Application development and O&M require many middleware and environment dependencies, and the development environment and O&M environment are often different.

Containers solve the contradiction between development and operations. Containers can package applications, and packaged containers can run in any environment. Containers bridge the gap between development and operations and are the best solution for DevOps.

Container is a sandbox technology, it will encapsulate application and the required resources, effectively will be a single operating system resources (run-time dependencies and configuration) into a single module, make the application run in the container, isolation with the outside world, in order to better balance between different modules have a conflict of resource usage requirements, Sandboxes can also be easily transferred to other host machines.

In essence, it is a special process. Resources, files, devices, status, and configurations are divided into separate Spaces using Namespace, Control groups, and chroot techniques.

Containers are completely sandboxed, have no interfaces with each other and, more importantly, have very low performance overhead.

1.3 compare

Virtualization technology is to run a complete operating system on hardware virtualization, and application processes run on the operating system. Virtual machines have limited capacity because the hypervisor that creates them is constrained by the limited resources of the machine.

The application process of the container runs directly on the kernel of the host machine, there is no kernel of its own in the container, and there is no hardware virtualization. Therefore, containers are much lighter than traditional virtual machines. Each container is isolated from each other, and each container has its own file system. Processes between containers do not affect each other and can distinguish computing resources. Containers share the same operating system kernel and package applications as the runtime environment, so the entire container can be moved, opened, and used in a variety of development, test, and production configurations.

Containers are isolation at the application level, while virtualization is isolation at the physical resource level.

2 Docker V.S. Kubernetes

2.1 Docker overview

Docker is an open source application container engine, which is based on the Go language and complies with the Apache2.0 protocol.

Docker allows developers to package their applications and dependencies into a lightweight, portable container that can then be distributed to any popular Linux machine, as well as virtualization. Docker allows applications to be isolated from each other, with multiple containers sharing the same operating system kernel and running on many major operating systems.

Docker’s advantages:

  1. Simplified configuration: Source code, runtime environment, and configuration can be packaged into a container that can run in different environments.
  2. Consolidation server
  3. Code pipelining management
  4. Debug ability
  5. Improve development efficiency: make the development environment, test environment and build environment very close to each other, and reduce errors that may occur in different parts of software engineering.
  6. Multi-tenant: A multi-tenant application is an application with running instances serving many customers.
  7. Isolation of application
  8. Rapid deployment

Install Docker on CentOS:The official documentation

 sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine
sudo yum install -y yum-utils

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

sudo yum install docker-ce
Copy the code

Sudo systemctl start Docker

2.2 Kubernetes

Kubernetes(K8S) is a container orchestration tool, container creation, management, scheduling, operation and maintenance, in the actual production environment there are generally thousands of containers to manage, so it will be applied to K8S to complete the container orchestration work. Docker Swarm is Docker’s own orchestration tool.

3 DevOps

DevOps is a collection of ideas, processes, and tools.

The core concepts of DevOps are trust and respect, agile goals, and open communication.

The DevOps process includes release planning, continuous integration, continuous release, continuous testing, continuous monitoring, and continuous improvement.

DevOps tools include version management tools, automation tools, deployment tools, monitoring tools, and more.

The resources

  1. What is Virtualization?
  2. Brief introduction of container Technology
  3. Docker official documentation