Have you ever wondered why we need Kubernetes when docker compose can be used to spin up multiple applications using a simple YAML?
If yes, then this blog is for you.
To begin with, let’s understand some basic concepts
- Container: Container is a running version of multiple apps / binaries packaged together.
- Docker: Docker is a tool to run containers seamlessly on any host environment. It provides virtualization and gets rid of the “It runs on my system problem“
Now, let’s draw comparison between docker compose and kubernetes
Docker Compose | Kubernetes |
---|---|
It is used to run containers on a single host | Kubernetes can run containers on multiple different hosts. This is the single most important difference between these two |
Docker compose does not have the concept of pod and can spin up only containers | Kubernetes creates pods which is a collection of containers that are packaged and run together |
The number of containers cannot be autoscaled to meet increased demand | The number of pods can be autoscaled to meet the increased demand |
Self heal mechanism is not available in docker compose. If a container fails, there is no way to restart it | Kubernetes supports self healing pods with the help of resources like deployments and replicasets |