This article github.com/smileArchit… Has been included. JavaMap is aMap of Java knowledge designed to help developers learn and not get lost! Java learning please look for JavaMap.

As K8S becomes more popular as a container choreography solution, some people are starting to compare Docker to K8S, asking: Doesn’t Docker smell good?

K8s is short for kubernets, with ‘8’ for the middle eight characters.

Docker and K8S are not direct competitors; they are interdependent. Docker is a container platform, and K8S is the coordinator of Docker and other container platforms.

The age of containers has come

Virtualization technology has gone through three times, without the evolution of container technology, there would be no Docker technology.

Evolution of Virtualization Technology

(1) The physical machine age: Multiple applications may run on a single machine.

Physical machine age

(2) Virtual machine era: a physical machine installed multiple virtual machines (VM), a virtual machine run multiple programs.

Virtual Machine Era

(3) Container age: a physical machine to install multiple container instances (container), a container run multiple programs.

Container age

Containerization solves a very troublesome problem in the process of software development. Describe it with a dialogue:

Tester: You have a problem with this feature.

Developer: My local is good.

Developers who write code, test it in their local environment, and then deploy it to test or production often run into a variety of problems. There are many reasons why the local perfectly running code appears a lot of bugs after deployment. There are many reasons: different operating systems, different dependency libraries, etc. In a word, it is because the local environment and remote environment are not consistent.

Containerization solves this key problem by separating software programs from the underlying environment in which they run. After coding, developers package the program into a container image, which lists the dependent environment in detail. Running standardized images in different containers solves the problem of environment inconsistency fundamentally.

A sharp knife weapon of containerization

Characteristics of containerization technology
  • Portability: does not depend on specific operating system or cloud platform, such as in Ali cloud or Tencent cloud directly at will migration.

  • Small footprint: A container only needs a dependency list for its application and all the containers and libraries it needs to run. It does not need to package all the dependencies together.

  • Shared bin and lib: Different containers can share bin and lib, further saving space.

Docker was born

In 2010, a young man founded a company named dotCloud in San Francisco, the United States, which developed the core technology of Docker and opened the era of container technology.

Docker original company

DotCloud then simplified and standardized its container technology and named it Docker, after the familiar whale logo.

New Logo Docker

In 2013, dotCloud announced that Docker would be open source. As more and more engineers discovered its advantages, Docker’s popularity quickly climbed and became one of the most popular open source technologies at that time.

More than 30% of businesses currently use Docker in their AWS environment, and this number continues to grow.

Docker usage is increasing

How does Docker work?

What most people talk about when they talk about Docker is Docker Engine, which is just a container to build and run.

Before running the container, you need to write a Docker File and generate an image through the dockerFile. Then you can run the Docker container.

The Docker File defines everything needed to run an image, including the operating system and where the software is installed. In general, you do not need to write a Docker File from scratch. In Docker Hub, there are images written by engineers from all over the world, and you can make changes based on this.

The need for orchestration systems led to K8S

Although Docker provides an open standard for containerized applications, a new set of issues arise with the growing number of containers:

  • How do you coordinate and schedule these containers?
  • How can I upgrade my application without interrupting service?
  • How do I monitor the health of my application?
  • How do I batch restart programs in containers?

Solving these problems requires container orchestration, which abstracts many machines into one large machine. Now the industry is more popular: K8S, Mesos, Docker Swarm.

In the early stages of the business development, only a few microservices were available, and Docker was sufficient. However, as the business grew in scale, more containers and more complex work were required for the operation and maintenance staff, and the choreography system was needed to rescue opers.

The declaration cycle of the application

A mature container orchestration system requires the following capabilities:

  • Handle a large number of containers and users

  • Load balancing

  • Authentication and security

  • Management service communication

  • Multi-platform deployment

K8s has a feud with Docker Swarm

k8s VS Docker Swarm

If you have to compare Docker to K8S, you should actually compare Docker Swarm to K8S.

Docker Swarm is Docker’s own solution for clustered deployment management, which has obvious advantages and can be more tightly integrated into the Docker ecosystem.

Swarm is Docker’s son, but it is still less popular than K8S, largely because of commercial and ecological reasons, not much to explain.

What is the K8S for?

K8s is a container coordinator developed by Google, donated to CNCF and now open source.

Google is leveraging its years of experience and expertise in container management to launch K8S, which is designed to automate the deployment of application containers and support a wide range of container tools including the now-popular Docker.

K8s is currently the market leader in container choreography, open source and has published a series of standardized methods that are being supported by the major public cloud platforms.

First-class manufacturers are in the commanding heights of the standard, a bunch of small manufacturers to play with, this is called ecology. What are the major domestic manufacturers doing? Grab the community group buy market, play the capital game, eh? !

K8s architecture and components

K8s is composed of many components, which communicate with each other through API, and can be summarized into three parts:

  • controller manager
  • nodes
  • pods
Architecture diagram of K8S cluster
  • The Controller Manager, or control plane, is used for scheduling programs and node status detection.

  • Nodes, which constitute the collective computing power of the Kubernetes cluster, where the actual deployment container runs.

  • Pods, the smallest unit of resources in a Kubernetes cluster.

Docker and K8S are inseparable

Docker and K8S are very popular in the industry and both have become de facto standards.

Docker is a platform and tool for building, distributing, and running containers.

K8s is actually a Docker container choreographed system that works around Pods. Pods are the smallest dispatching units in the K8S ecology and can contain one or more containers.

Docker and K8S are fundamentally different technologies, and they work well together.

Development practice, soul questioning

(1) Can I use Docker without K8S?

You can. In fact, some small companies, in the case of business is not too complex, use Docker directly. Although K8S has many benefits, it is known that it is very complex and can be abandoned when the business is simple.

(2) Can K8S be used without Docker?

K8s is just a container choreographer, no container to take what choreographer? !

K8s is often used in conjunction with Docker, but other containers can also be used, such as RunC, Containerted, etc.

(3) Docker Swarm and K8S

Choose k8s. Docker Enterprise was sold to Mirantis in late 2019, and Mirantis announced that Docker Swarm will be phased out and k8S will be used as the default choreography tool in the future.

One last question

Doesn’t Docker smell good? Why the K8s

Docker smells good, but K8S will have to be used once the business reaches a certain scale. Got it?

— END —

Daily cheeky beg praise: hello technology person, first praise hind see, develop a habit, don’t white whou yo.

About the author: ☕ read a few years: Huazhong University of Science and Technology master graduate; 😂 wave over several big factories: Huawei, netease, Baidu…… 😘 has always believed that technology can change life, willing to maintain the original aspiration, refueling technology people!

Wechat search public account [love laughing architect], pay attention to this technology and the pursuit of life.

Finally recommend a treasure open source project, github.com/smileArchit… JavaMap is aMap of Java knowledge that allows developers to learn without getting lost! Java learning please look for JavaMap. JAVA core knowledge point arrangement (283 pages, super detailed) free.