Kubernetes is more advanced than Docker. Difference between the Docker and Kubernetes is in the networking. Docker uses the Container Network Model (CNM) through libnetwork while Kubernetes has embraced Container Network Interface (CNI). libnetwork in the docker engine iteself. Docker is like the “virtual machines”. OpenVZ like tools had lot of problems in small scale deployment. Kubernetes is not a container itself. Kubernetes does the container orchestration. Kubernetes is like the “control panel” of the “virtual machines”. If Docker is VMs then Kubernetes is OpenStack or vCenter. Both OpenStack and vCenter has separate virtualization technology behind.
Also, Docker and Kubernetes are not direct competitors. Docker Swarm is the native clustering option for Docker. Docker Swarm includes the standard Docker API, all the tools which already communicates with a Docker daemon can use Docker Swarm to scale. It sounds like Docker system with Docker Swarm is great. We discussed the good part of Docker in our Analysis of Docker in DevOps article. Docker is several things together – a Linux container format, a container management system a company. But by the word Docker, people tend to point about the Docker container image format. Docker became more about packaging a software with these dependencies. Docker by itself is great for the purpose, but when it sucks at scaling. Kubernetes is a Container Orchestration Environment (COE). Docker Swarm is Docker’s Container Orchestration Environment (COE). These systems (including Kubernetes) are designed to manage the Containers while running multiple instances. Docker Swarm is useful for the people who are trying to get comfortable with an orchestrated environment on a simple deployment. Docker system with Docker Swarm is great for single server on same datacenter.
Easy function of Container Orchestration Environment (COE) is to launch an application and make sure that the application is running. In case of fail, COE would recognize and spin up another container. In the same way, it can scale up or down in response to demand. Most of us start our containerization journey with
docker-compose. Then why we have to learn complicated Kubernates? Rather, why in our articles like DevOps and Containerization Tools we listed both Docker and Kubernetes? Actually, Docker with Swarm does the basic job. Kubernetes still an advanced tool and the technology behind actually different.
Kubernetes aims to provide operations teams the mechanisms for management of containerized applications and introduces the concept of Pods. Pods are group of containers running under a single service, which has a persistent storage. Kubernetes handles the instantiation differently than the Docker stacks. Kubernetes need other technologies like etcd of CoreOS. Kubernetes is better to use when an application is developed with the diverse components across numerous containers on several machines. It fills up the need for the tool to manage and orchestrate the containers.
The above illustration is from practical discussion by
Kubernetes is for the distributed systems, as all-in-one framework. It is complex because it provides the guarantees about the cluster state. Kubernetes in many cases wrongly used than the real need. Apache Mesos, Rancher Cattle are alternatives which worth taking a look.