Skip to content

From Compose to Swarm to Kubernetes

Select an icon to see what it is.

Step 6 of 6

What to learn next

Kubernetes adds more objects, namespaces, ingress and operators on top of the same container base. The ideas from these lessons, namespaces, cgroups, images, volumes and networks, all still apply. Learn the Kubernetes objects next, the same way: one event at a time.

PrevNext

Carries over

images and registries
namespaces and cgroups through runc
bridge-style networking, DNS and published ports
volumes and secrets

Try it yourself

Run a service on Swarm with Docker alone. The kubectl commands at the end need kubectl and a cluster, such as kind or minikube. If docker swarm init asks for an address, add --advertise-addr with your host's IP.

$ docker swarm init
$ docker service create --name api --replicas 3 -p 8080:80 nginx
$ docker service ps api
$ docker service rm api
$ docker swarm leave --force
$ kubectl create deployment api --image=nginx --replicas=3
$ kubectl get pods
$ kubectl delete deployment api

Quiz

1. What does a Swarm manager do when a node fails?
2. Which Kubernetes object gives replicas one stable address?
3. What runs the containers on a Kubernetes node?