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

meetup_topic__1.pdf

ry
February 10, 2020

 meetup_topic__1.pdf

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

ry

February 10, 2020
Tweet

More Decks by ry

Other Decks in Education

Transcript

  1. Kubernetes Wakaran Tokyo #1
    Discussion Theme

    View full-size slide

  2. Prerequisite Knowledge

    View full-size slide

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

    View full-size slide

  4. What’s Container
    • ಉ͡OS্Ͱ෼཭͞ΕͨίϯςφۭؒΛ༻ҙ͠ɺݸʑʹΞϓϦέʔ
    γϣϯ΍ϥΠϒϥϦΛಈ͔͢͜ͱ͕Ͱ͖Δɻ
    • ΞϓϦέʔγϣϯʹՃ͑ͯɺOS ͱͦͷؔ࿈πʔϧ͕༰ྔʹؚ·ΕΔ
    VMͱൺֱ͢ΔͱϦιʔε໘Ͱͷܰྔੑ΍ɺىಈεϐʔυͷ଎͞ͳͲ
    ͷϝϦοτ͕͋Δଞɺϝϯςφϯεͷ؆қԽ౳༷ʑͳར఺͕͋Δɻ
    ෺ཧαʔό ෺ཧαʔό
    ϗετOS ϋΠύʔόΠβʔ
    Ծ૝ԽSW ήετOS ήετOS
    ήετOS
    ήετOS
    app
    app
    app app
    app app app
    ෺ཧαʔό
    ίϯςφΤϯδϯ
    VM Container

    View full-size slide

  5. What’s Pod
    • KubernetesͰ࡞੒͓Αͼ؅ཧͰ͖ΔɺσϓϩΠ
    Մೳͳ࠷খͷίϯϐϡʔςΟϯά୯Ґɻ
    • 1ͭҎ্ͷίϯςφͰߏ੒͞ΕΔɻ
    • Podʹ͸1ͭͷNic͕༩͑ΒΕɺίϯςφؒͰͦͷ
    1ͭͷNicΛڞ༗͢Δɻ

    View full-size slide

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

    View full-size slide

  7. Podͷ࡞੒
    ྡͷmanifestʹҎԼͷࣄ߲Λ௥هͯ͠ɺ
    PodΛ࡞੒͠·͠ΐ͏
    • Container name: nginx
    • Image: nginx (version 1.17.5)
    • Port: 80

    View full-size slide

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

    View full-size slide

  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Λߏ੒ͯ͠Έ͍ͯͩ͘͞ɻ

    View full-size slide

  10. ൃද಺༰
    1. [Replicaͷੜ੒]ʹ͓͍ͯɺ
    1-1. ͲͷWorkloads ResourceΛબ୒ͨ͠ͷ͔
    1-2. ͳͥͦΕΛબ୒ͨ͠ͷ͔
    2. [Updateઓུ]ʹ͓͍ͯ
    2-1. ͲͷΑ͏ͳmanifestΛߏஙͨ͠ͷ͔
    2-2. manifestΛߏங͢Δʹ͋ͨΓɺԿΛߟྀͨ͠ͷ͔
    (strategy΍maxSurge, maxUnavailableͳͲ)

    View full-size slide