Upgrade to Pro — share decks privately, control downloads, hide ads and more …

「入門Kubernetes」入門 / 20180609 GCPUG Hiroshima #4

「入門Kubernetes」入門 / 20180609 GCPUG Hiroshima #4

GCPUG Hiroshima #4 https://gcpug-hiroshima.connpass.com/event/85416/ で発表した際の資料

「入門Kubernetes」には図が少なく動きがイメージしにくいという欠点を補うべく、Kubernetesのリソースなどの動きを図を使って説明してみました。

doublemarket

June 09, 2018
Tweet

More Decks by doublemarket

Other Decks in Technology

Transcript

  1. ෺ཧϚγϯ͔Βίϯςφ΁ ϋʔυ΢ΣΞ OS ϥΠϒϥϦ ΞϓϦ ΞϓϦ ϋʔυ΢ΣΞ ϋΠύʔόΠβ OS ϥΠϒϥϦ

    ΞϓϦ ΞϓϦ OS ϥΠϒϥϦ ΞϓϦ ΞϓϦ ϋʔυ΢ΣΞ OS ϥΠϒ ϥϦ ΞϓϦ ΞϓϦ ϥΠϒ ϥϦ ϥΠϒ ϥϦ ΞϓϦ ΞϓϦ ϥΠϒ ϥϦ ίϯςφ࣮ߦ؀ڥ ෺ཧϚγϯ Ծ૝Ϛγϯ ίϯςφ
  2. ࣗݾճ෮γεςϜ Web Pod Node Web Pod Node Web Pod Node

    ৗʹίϯςφ͕3ͭಈ͘Α͏ʹ͸ͨΒ͘
  3. ࣗݾճ෮γεςϜ Web Pod Node Web Pod Node Web Pod Node

    Web Pod Node 4ͭ໨ΛखಈͰ࡞੒ͯ͠΋
  4. ࣗݾճ෮γεςϜ Web Pod Node Web Pod Node Web Pod Node

    Web Pod Node ৗʹίϯςφ͕3ͭಈ͘Α͏ʹ͸ͨΒ͘
  5. Podͷઃܭ Word Press DB Node Pod Node Node Word Press

    DB Pod Word Press DB Pod εέʔϧ͍ͨ͠ͷ͸͜ͷ୯Ґʁ
  6. Podͷઃܭ DB Node Pod Node Node Word Press Pod Word

    Press Pod Word Press Pod Word Press Pod Word Press Pod Word Press Pod DB Pod ࣮ࡍʹ͸͜ͷΑ͏ʹεέʔϧ͢Δ͸ͣ…
  7. Service kuard Node Pod kuard Node Pod env=prod ໊લ :

    alpaca-prod ϥϕϧ : app=alpaca, env=prod Service app=alpaca env=prod app=alpaca
  8. Service kuard Node Pod kuard Node Pod env=prod Service app=alpaca

    env=prod app=alpaca ΫϥελIP 10.115.245.13 alpaca-prod.default.svc.cluster.local ໊લ : alpaca-prod ϥϕϧ : app=alpaca, env=prod
  9. ServiceʹNodePortΛઃఆ kuard Node Pod kuard Node Pod env=prod Service app=alpaca

    env=prod app=alpaca ΫϥελIP 10.115.245.13 alpaca-prod.default.svc.cluster.local ໊લ : alpaca-prod ϥϕϧ : app=alpaca, env=prod NodePort 32711
  10. ReplicaSet kuard Node Pod Node kuard Node Pod app=kuard app=kuard

    ϨϓϦΧ : 2 ϥϕϧ : app=kuard ίϯςφ(Pod) : kuard ReplicaSet
  11. ReplicaSet ɿௐ੔ϧʔϓ kuard Node Pod Node kuard Node Pod ϨϓϦΧ

    : 4 ϥϕϧ : app=kuard ίϯςφ(Pod) : kuard ReplicaSet app=kuard app=kuard
  12. ReplicaSet : ௐ੔ϧʔϓ kuard Node Pod kuard Node Pod kuard

    Node Pod ϨϓϦΧ : 4 ϥϕϧ : app=kuard ίϯςφ(Pod) : kuard ReplicaSet app=kuard app=kuard app=kuard kuard Pod app=kuard
  13. ReplicaSet : ௐ੔ϧʔϓ kuard Node Pod kuard Node Pod kuard

    Node Pod app=kuard app=kuard app=kuard kuard Pod app=kuard ϨϓϦΧ : 4 ϥϕϧ : app=kuard ίϯςφ(Pod) : kuard ReplicaSet
  14. ReplicaSet : ௐ੔ϧʔϓ kuard Node Pod kuard Node Pod kuard

    Node Pod app=kuard app=kuard app=kuard kuard Pod app=kuard ϨϓϦΧ : 4 ϥϕϧ : app=kuard ίϯςφ(Pod) : kuard ReplicaSet
  15. DaemonSet Node Node Node ίϯςφ(Pod) : fluentd DaemonSet fluentd Pod

    app=fluentd fluentd Pod app=fluentd fluentd Pod app=fluentd
  16. DaemonSet : Nodeͷ੍ݶ Node Node Node ϥϕϧ : ssd=true ίϯςφ(Pod)

    : fluentd DaemonSet fluentd Pod app=fluentd fluentd Pod app=fluentd ssd=true ssd=true
  17. Job : 1ճݶΓ ໊લ : oneshot ίϯςφ(Pod) : kuard completions

    : 1 parallelism : 1 Job Node kuard Pod job=oneshot
  18. Job : 1ճݶΓ ໊લ : oneshot ίϯςφ(Pod) : kuard completions

    : 1 parallelism : 1 Job Node kuard Pod job=oneshot
  19. Job : Ұఆ਺੒ޭ͢Δ·Ͱ࣮ߦ Node Node Node Node Node ໊લ :

    oneshot ίϯςφ(Pod) : kuard completions : 10 parallelism : 5 Job
  20. Job : Ұఆ਺੒ޭ͢Δ·Ͱ࣮ߦ Node kuard Pod job=oneshot Node kuard Pod

    job=oneshot Node kuard Pod job=oneshot Node kuard Pod job=oneshot Node kuard Pod job=oneshot ໊લ : oneshot ίϯςφ(Pod) : kuard completions : 10 parallelism : 5 Job
  21. Job : Ұఆ਺੒ޭ͢Δ·Ͱ࣮ߦ Node kuard Pod job=oneshot kuard Pod job=oneshot

    Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot ໊લ : oneshot ίϯςφ(Pod) : kuard completions : 10 parallelism : 5 Job
  22. Job : Ұఆ਺੒ޭ͢Δ·Ͱ࣮ߦ ໊લ : oneshot ίϯςφ(Pod) : kuard completions

    : 10 parallelism : 5 Job Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot Node kuard Pod job=oneshot kuard Pod job=oneshot
  23. ConfigMap / Secret kuard Node Pod another-param = another-value extra-param

    = extra-value my-config.txt parameter1 = value1 parameter2 = value2 ConfigMap
  24. ConfigMap / Secret kuard Node Pod another-param = another-value extra-param

    = extra-value my-config.txt parameter1 = value1 parameter2 = value2 ConfigMap ConfigMap volume ANOTHER_PARAM=another-value EXTRA_PARAM=extra-value /config +- another-param +- extra-param +- my-config.txt +- parameter1 +- parameter2
  25. Deployment nginx Node Pod Node ϨϓϦΧ : 1 ϥϕϧ :

    run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet ϨϓϦΧ : 1 ໊લ : nginx ίϯςφ : nginx:1.7.12 Deployment run=nginx
  26. Deployment ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ : nginx:1.7.12

    Deployment ϨϓϦΧ : 1 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx Node Pod Node
  27. Deployment ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ : nginx:1.7.12

    Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx Node Pod Node nginx Pod
  28. Deployment ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ : nginx:1.7.12

    Deployment ϨϓϦΧ : 1 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx Node Pod Node nginx Pod
  29. Deploymentઓུ : Recreate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod
  30. Deploymentઓུ : Recreate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod
  31. Deploymentઓུ : Recreate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod nginx 1.9.10 Pod nginx 1.9.10 Pod ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.9.10 ReplicaSet run=nginx
  32. Deploymentઓུ : RollingUpdate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 maxAvailable : 1 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod
  33. Deploymentઓུ : RollingUpdate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 maxAvailable : 1 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod
  34. Deploymentઓུ : RollingUpdate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 maxAvailable : 1 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.9.10 ReplicaSet run=nginx nginx 1.9.10 Pod
  35. Deploymentઓུ : RollingUpdate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 maxAvailable : 1 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.9.10 ReplicaSet run=nginx nginx 1.9.10 Pod
  36. Deploymentઓུ : RollingUpdate ϨϓϦΧ : 2 ໊લ : nginx ίϯςφ

    : nginx:1.9.10 maxAvailable : 1 Deployment ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.7.12 ReplicaSet run=nginx nginx 1.7.2 Node Pod Node nginx 1.7.2 Pod ϨϓϦΧ : 2 ϥϕϧ : run=nginx ίϯςφ : nginx:1.9.10 ReplicaSet run=nginx nginx 1.9.10 Pod nginx 1.9.10 Pod
  37. StatefulSet Node Node mongo 0 Node Pod ϨϓϦΧ : 1

    ϥϕϧ : app=mongo ίϯςφ : mongo:3.4.1 StatefulSet app=m ongo
  38. StatefulSet mongo 1 Node Pod Node mongo 0 Node Pod

    app=m ongo ϨϓϦΧ : 3 ϥϕϧ : app=mongo ίϯςφ : mongo:3.4.1 StatefulSet app=m ongo
  39. StatefulSet mongo 1 Node Pod Node mongo 0 Node Pod

    app=m ongo ϨϓϦΧ : 3 ϥϕϧ : app=mongo ίϯςφ : mongo:3.4.1 StatefulSet app=m ongo mongo 2 Pod app=m ongo
  40. StatefulSet mongo 1 Node Pod Node mongo 0 Node Pod

    app=m ongo ϨϓϦΧ : 2 ϥϕϧ : app=mongo ίϯςφ : mongo:3.4.1 StatefulSet app=m ongo mongo 2 Pod app=m ongo
  41. PersistentVolume mongo 1 Node Pod Node mongo 0 Node Pod

    app=m ongo ϨϓϦΧ : 3 ϥϕϧ : app=mongo ίϯςφ : mongo:3.4.1 StatefulSet app=m ongo mongo 2 Pod app=m ongo ωοτϫʔΫετϨʔδ PersistentVolume
  42. ৘ใݯ • ެࣜυΩϡϝϯτ (ӳޠ) https://kubernetes.io/ • ॻ੶ • Kubernetes in

    Action (ӳޠ) • ϒϩά • Google Cloud (ӳޠ) https://medium.com/google-cloud • ެࣜϒϩά (ӳޠ) https://kubernetes.io/blog/
  43. ৘ใݯ • SlackϫʔΫεϖʔε https://slack.kubernetes.io/ • ೔ຊޠνϟϯωϧ #jp-users, #jp-events • Podcast

    • Kubernetes Podcast (ӳޠ) https://kubernetespodcast.com/ • ษڧձɾΧϯϑΝϨϯε • Kubernetes Meetup Tokyo (೔ຊޠ) https://k8sjp.connpass.com/ • KubeCon (ӳޠ)