The difference between docker, virtual machine and k8s

Table of contents

virtual machine

container technology

kubernetes


virtual machine

Traditional virtual machines such as VMware and VisualBox need to simulate the entire machine including hardware, and each virtual machine needs to have its own operating system. Once the virtual machine is started, all the resources pre-allocated to it will be occupied. Each virtual machine includes applications, necessary binaries and libraries, and a complete user operating system.

container technology

Container technology is to share hardware resources and operating system with our host machine, which can realize dynamic allocation of resources . A container contains an application and all its dependencies, but shares a kernel with other containers. Containers run as separate processes in user space on the host operating system.

Container technology is an approach to operating system virtualization that allows you to run applications and their dependencies in processes with isolated resources. By using containers, we can easily package an application's code, configuration, and dependencies into easy-to-consume building blocks that achieve environmental consistency, operational efficiency, developer productivity, and version control, among other goals. Containers help ensure that applications are deployed quickly, reliably, and consistently, regardless of the deployment environment. Containers also give us more fine-grained control over resources, making our infrastructure more efficient.

The three core concepts of Docker technology are:
image,
container, and
repository It's difficult -- all aspects of orchestration, management and scheduling , it's not easy. Therefore, people urgently need a management system for more advanced and flexible management of Docker and containers.

kubernetes

K8S is a container-based cluster management platform . Its full name is kubernetes.
A K8S system is usually called a K8S cluster (Cluster).
This cluster mainly includes two parts:
a Master node (master node)
and a group of Node nodes (computing nodes)

The Master node is mainly responsible for management and control. The Node node is a workload node, which contains specific containers.
The Master node includes API Server, Scheduler, Controller manager, etcd.
API Server is the external interface of the entire system, which is called by clients and other components, which is equivalent to a "business hall".
The Scheduler is responsible for scheduling the resources within the cluster, which is equivalent to a "scheduling room".
Controller manager is responsible for managing the controller, which is equivalent to the "big manager".

Node nodes include Docker, kubelet, kube-proxy, Fluentd, kube-dns (optional), and Pod.

Pod is the most basic operating unit of Kubernetes. A Pod represents a process running in the cluster , which encapsulates one or more closely related containers . In addition to Pod, K8S also has a concept of Service. A Service can be regarded as the external access interface of a group of Pods that provide the same service.

Specific features :
Automate container deployment and replication.
Real-time elastic shrink container size.
Containers are organized into groups and load balancing among containers is provided.
Scheduling: On which machine the container runs.
Composition:
kubectl : client command line tool, as the operation entry of the whole system.
Kubelet : It is mainly responsible for monitoring the Pod assigned to its Node, including creation, modification, monitoring, deletion, etc.
Fluentd : mainly responsible for log collection, storage and query.
kube-apiserver: Provides an interface in the form of a REST API service as the control entry of the entire system.
kube-controller-manager: Execute background tasks of the entire system, including node status, number of Pods, association between Pods and Services, etc.
kube-scheduler: Responsible for node resource management, receiving tasks from kube-apiserver to create Pods, and assigning them to a node.
etcd: Responsible for service discovery and configuration sharing between nodes.
kube-proxy: mainly responsible for providing proxy for Pod objects. Runs on each computing node and is responsible for Pod network proxy. Obtain service information from etcd regularly to make corresponding policies.
DNS: An optional DNS service used to create DNS records for each Service object, so that all Pods can access the service through DNS.

Guess you like

Origin blog.csdn.net/qq_34474071/article/details/123518791