9

How do containers work when you're using both Docker and Kubernetes?

 3 years ago
source link: https://dev.to/ghost/how-do-containers-work-when-youre-using-both-docker-and-kubernetes-5o6
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How do containers work when you're using both Docker and Kubernetes?

Dec 6, 2017

・1 min read

I'm new to containerisation, and have never actually used it in practise... or even used any of my developing skills in practice since I'm new to this whole 'developing' thing. I think I've got a really basic understanding of containers, but I don't understand how you'd use Kubernetes and Docker together in a workflow?

I really should have made this a like 'Explain Like I'm 5' sorta thing.

Discussion (4)

pic

CollapseExpand

Docker runs containers. Kubernetes orchestrates containers. Orchestration is how you stitch multiple containers together into a greater whole: for example, you can have several application containers (and scale out to add more application containers at runtime) talking to a database container. It's possible to do this with Docker alone, but prohibitively complicated at the low level of individual containers. The language of "pods", "services", "deployments", and so on that Kubernetes employs lets you operate at the level of multiple interacting containers instead.

Comment button Reply

CollapseExpand

Thanks for the reply! That really clears up everything - I thought that Kubernetes runed containers like Docker!

Comment button Reply

CollapseExpand

To add:

You could manage a small cluster of Docker containers on one host machine with a good memory and some facility with Bash. Where orchestration really comes into its own is when you need to scale across multiple hosts.

There are other technologies that do overlap with Kubernetes, notably the combination of Docker Swarm + Docker Compose. Kubernetes has support for more complex workflows with stuff like jobs which run once and exit, while Compose is purely about describing what your cluster looks like and then making that happen.

Comment button Reply

CollapseExpand

I know this maybe a little bit more than ELI5 but if you want to dive further, "container" don't really exist

So basically a "container" is a combination of cgroup restrictions and namespaces, kubernetes adds containers to the same namespace so that they can be called as if they where in the same localhost.

Also, kubernetes is testing support for rkt which is kind of a docker competitor on its own.

Now, kubernetes orchestrates containers, this basically means it handles them through some strategies (deployments, daemon sets, replica sets, etc).

Comment button Reply


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK