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

meetup_topic__1.pdf

30d97c8383a531c459ac210540b4eace?s=47 ry
February 10, 2020

 meetup_topic__1.pdf

Kubernetes Wakaran Tokyo #1にて扱う問題です。

30d97c8383a531c459ac210540b4eace?s=128

ry

February 10, 2020
Tweet

Transcript

  1. Kubernetes Wakaran Tokyo #1 Discussion Theme

  2. Prerequisite Knowledge

  3. What’s Kubernetes • ίϯςφԽ͞ΕͨΞϓϦέʔγϣϯ΍αʔϏεΛ ؅ཧ͢ΔͨΊͷΦʔϓϯιʔεϓϥοτϑΥʔϜ ϩʔϦϯάΞοϓσʔτ εέʔϦϯά / ΦʔτεέʔϦϯά ίϯςφͷࢮ׆؂ࢹ

    ো֐࣌ͷηϧϑώʔϦϯά etc…
  4. What’s Container • ಉ͡OS্Ͱ෼཭͞ΕͨίϯςφۭؒΛ༻ҙ͠ɺݸʑʹΞϓϦέʔ γϣϯ΍ϥΠϒϥϦΛಈ͔͢͜ͱ͕Ͱ͖Δɻ • ΞϓϦέʔγϣϯʹՃ͑ͯɺOS ͱͦͷؔ࿈πʔϧ͕༰ྔʹؚ·ΕΔ VMͱൺֱ͢ΔͱϦιʔε໘Ͱͷܰྔੑ΍ɺىಈεϐʔυͷ଎͞ͳͲ ͷϝϦοτ͕͋Δଞɺϝϯςφϯεͷ؆қԽ౳༷ʑͳར఺͕͋Δɻ

    ෺ཧαʔό ෺ཧαʔό ϗετOS ϋΠύʔόΠβʔ Ծ૝ԽSW ήετOS ήετOS ήετOS ήετOS app app app app app app app ෺ཧαʔό ίϯςφΤϯδϯ VM Container
  5. What’s Pod • KubernetesͰ࡞੒͓Αͼ؅ཧͰ͖ΔɺσϓϩΠ Մೳͳ࠷খͷίϯϐϡʔςΟϯά୯Ґɻ • 1ͭҎ্ͷίϯςφͰߏ੒͞ΕΔɻ • Podʹ͸1ͭͷNic͕༩͑ΒΕɺίϯςφؒͰͦͷ 1ͭͷNicΛڞ༗͢Δɻ

  6. Today’s Topic 1-1. Podͷ࡞੒ 1-2. Serviceͷ࡞੒ 1-3. Replicaͷੜ੒ ~ ൃల

    ~ 2-1. Updateઓུ
  7. Podͷ࡞੒ ྡͷmanifestʹҎԼͷࣄ߲Λ௥هͯ͠ɺ PodΛ࡞੒͠·͠ΐ͏ • Container name: nginx • Image: nginx

    (version 1.17.5) • Port: 80
  8. Serviceͷ࡞੒ ྡͷmanifestΛ༻͍ͯɺService Λ࡞੒͠·͢ɻ ͦͷޙɺlocalhost:30080ʹΞΫηεͯ͠ɺ ҎԼͷΑ͏ͳը໘͕ग़Δ͜ͱΛ֬ೝ͠·͢ɻ

  9. Replicaͷੜ੒ • ೚ҙͷWorkloads ResourceΛ༻͍ͯɺ[1. Podͷ࡞੒]Ͱ࡞੒ͨ͠podΛ 4 replicaͷϦιʔεͱͯ͠࡞੒͍ͯͩ͘͠͞ɻ ·ͨɺͦͷWorkloads ResourceΛબ୒ͨ͠ཧ༝ʹ͍ͭͯ·ͱΊͯΈ·͠ΐ͏ɻ Workloads

    Resource: Pod, ReplicaSet, Deployment, DaemonSet, StatefulSet Updateઓུ • [3. Replicaͷੜ੒]ʹͯ࡞੒͞ΕϦιʔεʹ࢖༻͞Ε͍ͯΔnginxͷversionΛ1.17.7 ʹ্͛Α͏ͱߟ͍͑ͯ·͢ɻμ΢ϯλΠϜ͕ͳ͍Α͏ʹΞοϓσʔτΛ͢Δʹ͸ɺ ɹmanifestʹ͓͍ͯɺͲͷΑ͏ͳ͜ͱΛઃఆ͢Δඞཁ͕͋ΔͰ͠ΐ͏͔ɻ ɹཧ༝΋ؚΊͯɺmanifestΛߏ੒ͯ͠Έ͍ͯͩ͘͞ɻ
  10. ൃද಺༰ 1. [Replicaͷੜ੒]ʹ͓͍ͯɺ 1-1. ͲͷWorkloads ResourceΛબ୒ͨ͠ͷ͔ 1-2. ͳͥͦΕΛબ୒ͨ͠ͷ͔ 2. [Updateઓུ]ʹ͓͍ͯ

    2-1. ͲͷΑ͏ͳmanifestΛߏஙͨ͠ͷ͔ 2-2. manifestΛߏங͢Δʹ͋ͨΓɺԿΛߟྀͨ͠ͷ͔ (strategy΍maxSurge, maxUnavailableͳͲ)