preface

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

K8s is short for kubernets. The ‘8’ stands for the middle eight characters.

In fact, Docker and K8S are not direct competitors, they are interdependent. Docker is a container platform, and K8S is the coordinator of container platforms such as Docker.

The age of containerization has arrived

Virtualization technology has gone through three eras, and without the evolution of containerization technology, Docker technology would not have been born.

Virtualization Technology Evolution

(1) Physical machine era: Multiple applications may run on a single machine.

Physical machine age

(2) Virtual machine era: a physical machine installs multiple virtual machines (VMS), and a VIRTUAL machine runs multiple programs.

Virtual Machine Era

(3) Containerization era: one physical machine installs multiple containers, and one container runs multiple programs.

Containerization age

Containerization solves one of the most frustrating problems in software development, described in a dialog:

Tester: You have a problem with this function.

Developer: MY local is good.

Developers who write code and deploy it to a test or production environment after testing in their own local environment often encounter a variety of problems. Obviously, there are many reasons why the code that runs perfectly locally has many bugs after deployment: different operating systems, different dependent libraries, etc. In a word, it is because the local environment and remote environment are inconsistent.

Containerization addresses this key problem by separating the software program from the underlying environment in which it is run. After coding, the developer packages the program into a container image, which lists the dependent environment in detail. Running the standardized image in different containers fundamentally solves the problem of inconsistent environment.

The sharp knife weapon of containerization technology

Characteristics of containerization technology:

  • Portability: do not depend on the specific operating system or cloud platform, such as ali Cloud or Tencent cloud directly at will migration.
  • Small footprint: A container only needs a dependency list of its application and all the containers and libraries it needs to run, not all of the dependency libraries packaged together.
  • Sharing bin and lib: Different containers can share bin and lib, further saving space.

Docker came out of nowhere

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

Docker’s original company name

Later, dotCloud simplified and standardized its container technology and named it Docker, which is 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 rose rapidly and became one of the hottest open source technologies at that time.

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

Docker usage is increasing

How do I use Docker?

In fact, most people talk about Docker as a Docker Engine, which is just a container to build and run.

Docker File needs to be written before running the container, and the image can be generated through dockerFile before running the Docker container.

The Docker File defines everything you need to run an image, including the operating system and software installation location. In general, you don’t need to write Docker files from scratch, there are images written by engineers from all over the world in Docker Hub, you can modify based on this.

The need for orchestration systems spawned the K8S

Although Docker provides an open standard for containerized applications, a new set of problems arise as more and more containers become available:

  • 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 choreography, which abstracts many machines into a single, supersized machine. K8s, Mesos and Docker Swarm are popular in the industry.

In the early stage of business development, there were only a few micro services, and Docker was enough at that time. However, as the business scale gradually expanded and containers became more and more, the work of operation and maintenance personnel became more and more complicated, it was necessary to arrange the system to rescue opers.

The declaration cycle of the application

A mature container choreography system requires the following capabilities:

  • Handle a large number of containers and users
  • Load balancing
  • Authentication and security
  • Managed Service communication
  • Multi-platform Deployment

K8s and Docker Swarm

k8s VS Docker Swarm

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

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

Although Swarm is Docker’s son, it is still not as popular as K8S, which is largely due to commercial and ecological reasons. There are few explanations.

What’s the K8S for?

K8s is a Container coordinator developed by Google, which has been donated to CNCF and is now open source.

Leveraging years of experience and expertise in container management, Google has launched K8S for automated deployment of application containers that support a wide range of container tools including the now very popular Docker.

K8s is currently the market leader in container choreography, open source and published a series of standardized methods, the mainstream public cloud platform announced support.

First-class manufacturers are seizing the commanding heights of the standard, and a bunch of small manufacturers follow to play together, which is called ecology. What are the major domestic manufacturers doing? Grab the community groupon market, play the capital game, eh? !

K8s architecture and components

K8s consists of a large number of components, which communicate with each other through APIS. It can be summarized into three parts:

  • controller manager
  • nodes
  • pods

K8s cluster architecture diagram

The Controller Manager, or control plane, is used for schedulers and node status detection.

  • Nodes, the collective computing power that makes up the Kubernetes cluster, is where the actual deployment container runs.
  • Pods, the smallest unit of resources in a cluster.

Docker and K8S are inseparable

Docker and K8S are so popular in the industry that they are already de facto standards.

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

K8s is actually a Docker container orchestrated system that works around Pods. Pods are the smallest scheduling unit in the K8S ecosystem and can contain one or more containers.

Docker and K8S are fundamentally different technologies that work well together.

Development practice, soul questioning

(1) Can DOCker be used without K8S?

You can. In fact, some small companies directly use Docker when their business is not too complicated. Although K8S has many benefits, it is known to be very complex and easy to do business without using IT.

(2) Can I use K8S without Docker?

K8s is just a container choreographer. What’s a container choreographer without? !

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

Docker Swarm and K8S

Choose k8s. Docker Enterprise was sold to Mirantis at the end of 2019, and Mirantis announced that Docker Swarm would be phased out and k8S would be the default choreography tool.

One last question

Doesn’t Docker smell good? Why use the K8S

Docker smells good, but K8S needs to be enabled once the business reaches a certain scale. Have you learned?

The Path to Advanced JAVA Architecture