ContainerDay 2018
Verona, 26/10/2018
AND WHY THIS TALK?
- Dario Tranchitella (ContainerDay 2018)
A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers. A pod’s contents are always co-located and co-scheduled, and run in a shared context. A pod models an application-specific “logical host” - it contains one or more application containers which are relatively tightly coupled — in a pre-container world, being executed on the same physical or virtual machine would mean being executed on the same logical host.
https://kubernetes.io/docs/concepts/workloads/pods/pod/
MORE INFO?
Giulio De Donato: Isoliamo un Processo senza Container (ContainerDay 2016)
https://github.com/kubernetes/kubernetes/blob/master/build/pause/pause.c
examine and change a signal action. returns 0 on success; on error, -1 is returned.
Interrupt from keyboard
Termination signal
Child stopped or terminated
https://github.com/openshift/origin/blob/master/images/pod/pod.go
Go signal notification works by sending os.Signal values on a channe
It's sigint (2)
It's sigterm (15)
It's sigkill (9)
[Unit]
Description=PubePod, awesome pod orchestrated at mentula canis
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull k8s.gcr.io/pause-amd64:3.1
ExecStartPre=/usr/bin/echo "This could be a init script, wdyt?"
ExecStartPre=/usr/bin/docker volume create pod_volume
ExecStart=/usr/bin/docker run --rm --name pod k8s.gcr.io/pause-amd64:3.1
ExecStop=/usr/bin/docker stop pod
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=pod.foo
After=docker.service pod.service
Requires=docker.service pod.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull redis:alpine
ExecStart=/usr/bin/docker run --rm --name pod.foo -v pod_volume:/etc/pod --pid container:pod redis:alpine
ExecStop=/usr/bin/docker stop pod.foo
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=pod.bar
After=docker.service pod.service
Requires=docker.service pod.service
[Service]
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull redis:alpine
ExecStart=/usr/bin/docker run --rm --name pod.bar -v pod_volume:/etc/pod --pid container:pod nginx:alpine
ExecStop=/usr/bin/docker stop pod.bar
Restart=always
[Install]
WantedBy=multi-user.target