From 34a17aa0974101422ec58505e24070bbdbd55dd0 Mon Sep 17 00:00:00 2001 From: Julien Girardin Date: Fri, 6 Dec 2019 16:40:00 +0100 Subject: [PATCH 1/2] Add a Pod anatomy set of slides --- slides/images/kubernetes_pods.drawio | 1 + slides/images/kubernetes_pods.svg | 3 +++ slides/intro-fullday.yml | 1 + slides/k8s/Pods_anatomy.md | 27 +++++++++++++++++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 slides/images/kubernetes_pods.drawio create mode 100644 slides/images/kubernetes_pods.svg create mode 100644 slides/k8s/Pods_anatomy.md diff --git a/slides/images/kubernetes_pods.drawio b/slides/images/kubernetes_pods.drawio new file mode 100644 index 00000000..05573b10 --- /dev/null +++ b/slides/images/kubernetes_pods.drawio @@ -0,0 +1 @@ +3VhLU9swEP41nmkPzcR2EpIjCaHtUEo6HCi9dBRb2BoUy8hyHvz6rmzJD9mBQBJgmoMjrVcr6dtvVytb7mSx/spRHF4yH1PL6fpryz2zHMcZ9Rz4k5JNLrFtd5RLAk58JSsF1+QRK2FXSVPi46SmKBijgsR1oceiCHuiJkOcs1Vd7Y7R+qwxCnBDcO0h2pTeEF+EuXTonJTyb5gEoZ7ZHqj9LZBWVjtJQuSzVUXkTi13whkTeWuxnmAq0dO45OPOt7wtFsZxJHYZ8PfXAwsvwsvLP5duOpn2bx4ufnyx1WqXiKZqx5YzoGBw7JMlNAPZDFkiQOkTGF8iDk9K5vC8T+eYYnhz3ul0Putxc66HaQkoVIwpNMRGQ8xZGvlYrrILr1chEfg6Rp58uwJWyfnFgkLPhiaiJIigzXPMlbUl5gKvtwJjF3ADUTFbYME3oKIGDJWDFEXdruqvSn/3ekoWVn2tPYsUx4LCdOkGaChPvMQrDafMmL8fbiHj5JFFAmmBhIwAz08VoILFR4GztyOaheLB0XQaaMYoTXCeNAQiEeb7YXsA0AoubeogVlBz3RbUjgaa2wAtCki0/nBA2S38elukei0Z1AAJR/6pPIug51GUJMSr4wJ755vf1c6tBLTT192ztQI47210b01EMQzalVHQKwfJTjHGh/NNLQ3TOVtNS4FykFR52j2wO5ZyDz9PIIF4gMVz0dl0d8Wd/RZvahnHFAmyrC+3zcVqhhkjkaiwqWvk/oHBknybalT1cDUN9Q1DtmEox6FhCGiBNhW1WCok2xfcM7Kr7dYOfWjkFks6F5i+nuHNGiHm0miI00TSZR0ziOiPl0SdlpP8bXOD3TzJd0sOCfBFaHHEIvxBE0a2znMiUcmUd00g7xXwPSNOHbOG2zXgTUNFJjl2wA/eIODtYQttG7eCn1isGL+3JIQDtJDxnD9B8n02yeU7XgkaxiO0wEmWLLKbEydRsON1AvKHaL8zeMBBSFPN2ndBfD+jM8cJeUTzzJSks/IO2O2Prf6ZnM4dUwTXnjHy7oMswU0YZTyb2r3LftIOE8BSJm2PyrBoSW7q2qqmtAo6VgPmicyyNRV2O1Bl92rM0XXwvkfm0AigugF2d5dgYVD0MKRslqQN3wNTYpxlTIGfP3LmhQ+vUkGJTLKZ3Ef8/gpGEZHlwE5XJsgk/zThHOmscp3mWTVoyYPDox1VB6hjP3r2t/XnKBP0F5d7hiF7aITBlux/sFgY/E+x4JhV+LvHwsn+saBLLV1P3VZrK7lxe1QWXtX6bIY5gW3Ig+pFJdUOd7KcNu8VfeaHoZNXBp9jlvlm+f7q4INu+T02Vy8/a7vTfw== \ No newline at end of file diff --git a/slides/images/kubernetes_pods.svg b/slides/images/kubernetes_pods.svg new file mode 100644 index 00000000..b878be95 --- /dev/null +++ b/slides/images/kubernetes_pods.svg @@ -0,0 +1,3 @@ + + +
host (/var/lib/kubelet/...)
<div>host (/var/lib/kubelet/...)<br></div>
Pod
Pod
pause container
pause container
nginx
nginx
prometheus exporter
prometheus exporter
Network & IPC
namespace sharing
[Not supported by viewer]
:80
:80
private IP
private IP
\ No newline at end of file diff --git a/slides/intro-fullday.yml b/slides/intro-fullday.yml index e5d32e8a..8628bba5 100644 --- a/slides/intro-fullday.yml +++ b/slides/intro-fullday.yml @@ -68,6 +68,7 @@ chapters: #- containers/Containers_From_Scratch.md - - containers/Container_Engines.md + - k8s/Pods_anatomy.md #- containers/Ecosystem.md - containers/Orchestration_Overview.md - shared/thankyou.md diff --git a/slides/k8s/Pods_anatomy.md b/slides/k8s/Pods_anatomy.md new file mode 100644 index 00000000..6c4db842 --- /dev/null +++ b/slides/k8s/Pods_anatomy.md @@ -0,0 +1,27 @@ +# container super-structure (Pods) + +A container super-structure supported by many container engine seems to emerge, +we will see how it maps in the docker worlds + + + +--- +class: pic + +## Pod + +![Pods](images/kubernetes_pods.svg) +--- +# Anatomy of a Pod + +- The containers inside a pod share the network namespace (`--net=container:`) + + => the one of the "pause" containers + +- This means that if the container "pause" is killed all other container are killed + +- This is the reason for this container to do nothing but being alive + +- Containers can contact other container port via `localhost` + +- Containers don't share filesystem except the volumes you want to mount on each of them From e8eb11e257e5c93e7de5e3e6708efd0d1dc1e392 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Fri, 6 Dec 2019 14:43:57 -0600 Subject: [PATCH 2/2] Tweak Pods Anatomy slides for inclusion in master --- slides/containers/Pods_Anatomy.md | 47 +++++++++++++++++++++++++++++++ slides/intro-fullday.yml | 2 +- slides/intro-selfpaced.yml | 1 + slides/k8s/Pods_anatomy.md | 27 ------------------ 4 files changed, 49 insertions(+), 28 deletions(-) create mode 100644 slides/containers/Pods_Anatomy.md delete mode 100644 slides/k8s/Pods_anatomy.md diff --git a/slides/containers/Pods_Anatomy.md b/slides/containers/Pods_Anatomy.md new file mode 100644 index 00000000..e5272970 --- /dev/null +++ b/slides/containers/Pods_Anatomy.md @@ -0,0 +1,47 @@ +# Container Super-structure + +- Multiple orchestration platforms support some kind of container super-structure. + + (i.e., a construct or abstraction bigger than a single container.) + +- For instance, on Kubernetes, this super-structure is called a *pod*. + +- A pod is a group of containers (it could be a single container, too). + +- These containers run together, on the same host. + + (A pod cannot straddle multiple hosts.) + +- All the containers in a pod have the same IP address. + +- How does that map to the Docker world? + +--- + +class: pic + +## Anatomy of a Pod + +![Pods](images/kubernetes_pods.svg) + +--- + +## Pods in Docker + +- The containers inside a pod share the same network namespace. + + (Just like when using `docker run --net=container:` with the CLI.) + +- As a result, they can communicate together over `localhost`. + +- In addition to "our" containers, the pod has a special container, the *sandbox*. + +- That container uses a special image: `k8s.gcr.io/pause`. + + (This is visible when listing containers running on a Kubernetes node.) + +- Containers within a pod have independent filesystems. + +- They can share directories by using a mechanism called *volumes.* + + (Which is similar to the concept of volumes in Docker.) diff --git a/slides/intro-fullday.yml b/slides/intro-fullday.yml index 8628bba5..19014fc3 100644 --- a/slides/intro-fullday.yml +++ b/slides/intro-fullday.yml @@ -68,7 +68,7 @@ chapters: #- containers/Containers_From_Scratch.md - - containers/Container_Engines.md - - k8s/Pods_anatomy.md + - containers/Pods_Anatomy.md #- containers/Ecosystem.md - containers/Orchestration_Overview.md - shared/thankyou.md diff --git a/slides/intro-selfpaced.yml b/slides/intro-selfpaced.yml index 14c494b3..26b036ac 100644 --- a/slides/intro-selfpaced.yml +++ b/slides/intro-selfpaced.yml @@ -59,6 +59,7 @@ chapters: - containers/Copy_On_Write.md #- containers/Containers_From_Scratch.md - - containers/Container_Engines.md + - containers/Pods_Anatomy.md - containers/Ecosystem.md - containers/Orchestration_Overview.md - shared/thankyou.md diff --git a/slides/k8s/Pods_anatomy.md b/slides/k8s/Pods_anatomy.md deleted file mode 100644 index 6c4db842..00000000 --- a/slides/k8s/Pods_anatomy.md +++ /dev/null @@ -1,27 +0,0 @@ -# container super-structure (Pods) - -A container super-structure supported by many container engine seems to emerge, -we will see how it maps in the docker worlds - - - ---- -class: pic - -## Pod - -![Pods](images/kubernetes_pods.svg) ---- -# Anatomy of a Pod - -- The containers inside a pod share the network namespace (`--net=container:`) - - => the one of the "pause" containers - -- This means that if the container "pause" is killed all other container are killed - -- This is the reason for this container to do nothing but being alive - -- Containers can contact other container port via `localhost` - -- Containers don't share filesystem except the volumes you want to mount on each of them