Kubernetes: Understanding Pods vs. Containers

Kubernetes: Understanding Pods vs. Containers

A short illustration of how processes -> containers -> pods -> applications

569f10721398d92f5033097ac6d9132c?s=128

Tim Hockin

July 14, 2017
Tweet

Transcript

  1. Google Cloud Platform Kubernetes: Understanding Pods vs. Containers Tim Hockin

    <thockin@google.com> Principal Software Engineer @thockin
  2. Google Cloud Platform We get a lot of questions about

    how best* to use Pods and Containers and replication in Kubernetes * There is no “best”, but you can’t decide what you need until you understand the options.
  3. Google Cloud Platform Use-case: You are thirsty.

  4. Google Cloud Platform Here, have some atomic particles: + -

    + - + + + + + + + + = = = = = = = = - - - - - - - -
  5. Google Cloud Platform Are you satisfied? + - + -

    + + + + + + + + = = = = = = = = - - - - - - - -
  6. Google Cloud Platform No. You can’t drink that*. + -

    + - + + + + + + + + = = = = = = = = - - - - - - - - * While fundamental to everything they are not helpful here.
  7. Google Cloud Platform Here, have some hydrogen and oxygen: +

    - + - = - = = = = = = = = = = = = = = + - - - - - - -
  8. Google Cloud Platform Are you satisfied? + - + -

    = - = = = = = = = = = = = = = = + - - - - - - -
  9. Google Cloud Platform No. That is just a bunch of

    atoms*, you can’t drink that. * Atoms are very useful, but they don’t solve your current problem. + - + - = - = = = = = = = = = = = = = = + - - - - - - -
  10. Google Cloud Platform Let me join those for you: =

    - = = = = = = = = = = = = = = + - - - - - - - + + - -
  11. Google Cloud Platform Are you satisfied? = - = =

    = = = = = = = = = = = = + - - - - - - - + + - -
  12. Google Cloud Platform No. That is some other atom. You

    need water. = - = = = = = = = = = = = = = = + - - - - - - - + + - -
  13. Google Cloud Platform Let me compose them for you: H

    H O
  14. Google Cloud Platform Are you satisfied? H H O

  15. Google Cloud Platform No. That is water*, but it is

    just one molecule. H H O * H 2 O is a very useful composition of atoms (a molecule) that addresses your current problem, but only partially.
  16. Google Cloud Platform Let me scale that for you: H

    H O H H O
  17. Google Cloud Platform Are you satisfied? H H O H

    H O
  18. Google Cloud Platform No, that’s not water any more. H

    H O H H O * H 4 O 2 isn’t even a stable compound.
  19. Google Cloud Platform How about now? H H O H

    H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O H H O
  20. Google Cloud Platform That’s pretty good. But you really wanted

    sugar* water. * C 12 H 22 O 11
  21. Google Cloud Platform We already know that joining inside the

    molecule doesn’t work*. * C 12 H 24 O 12 is lactose monohydrate - not sugar water H H O
  22. Google Cloud Platform I’ll just mix these together*: * A

    solution. H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11
  23. Google Cloud Platform Are you satisfied? H 2 O C

    12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11
  24. Google Cloud Platform No. That is way too sweet*. *

    Mixing in equal proportions is not always right. H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 1 1 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11 H 2 O C 12 H 22 O 11
  25. Google Cloud Platform I’ll adjust the proportions: H 2 O

    C 12 H 22 O 11 H 2 O H 2 O H 2 O H 2 O C 12 H 22 O 11 H 2 O H 2 O H 2 O
  26. Google Cloud Platform Are you satisfied? H 2 O C

    12 H 22 O 11 H 2 O H 2 O H 2 O H 2 O C 12 H 22 O 11 H 2 O H 2 O H 2 O
  27. Google Cloud Platform YES. H 2 O C 12 H

    22 O 11 H 2 O H 2 O H 2 O H 2 O C 12 H 22 O 11 H 2 O H 2 O H 2 O
  28. Google Cloud Platform How does this apply to Kubernetes?

  29. Google Cloud Platform • Particle = Process in a Container

    ◦ Not very useful alone, but composable into many distinct forms • Atom = Container ◦ Useful on its own, but is also composable into something larger • Molecule = Pod ◦ Has a specific composition and behavior ◦ Changing the composition changes the behavior • Scaling an application does not mean scaling all Pods equally