April 2018
Beginner
398 pages
10h 11m
English
After all this theory, you might be wondering how a pod is actually created by Kubernetes. Kubernetes is only using what Docker provides. So, how does this network namespace share work? First, Kubernetes creates the so-called pause container as mentioned previously. This container has no other function than to reserve the kernel namespaces for that pod and keep them alive, even if no other container inside the pod is running. Let's simulate the creation of a pod, then. We start by creating the pause container and take Nginx for this purpose:
$ docker container run -d --name pause nginx:alpine
And now we add a second container called main, attaching it to the same network namespace as the pause container:
$ docker ...
Read now
Unlock full access