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

KubernetesHandson

7ba12981020b07491850af953d794f54?s=47 aoi
January 31, 2020

 KubernetesHandson

7ba12981020b07491850af953d794f54?s=128

aoi

January 31, 2020
Tweet

Transcript

  1. Kubernetes ϋϯζΦϯ

  2. ࣗݾ঺հ • ͓͍͋(@_a0i) • αΠϘ΢ζגࣜձࣾSRE •

  3. Kubernetesͱ͸

  4. …ͷલʹ

  5. ίϯςφΛຊ൪Ͱ ࢖͏ͱ͖ʹ Ͳ͏͍͏͜ͱ͕ඞཁʁ

  6. ίϯςφΛຊ൪ӡ༻͢Δࡍ ΍Γͨ͘ͳΔͩΖ͏͜ͱ ɾෳ਺ίϯςφΛಉ࣌ʹ্ཱ͍ͪ͛ͨ ɾίϯςφΛ৑௕Խ͍ͨ͠ ɾωοτϫʔΫΛ্ख͍͜ͱ΍Γ͍ͨ ͳͲͳͲ

  7. ͜ΕΒΛ KubernetesͰ ղܾʂ

  8. Kubernetesͱ͸ • ίϯςφΦʔέετϨʔγϣϯπʔϧ • ଞʹ΋Docker Compose΍Docker Swarm • ෳ਺ίϯςφΛຊ൪ӡ༻͢ΔͨΊʹཉ͍͠ɺ ඞཁͳػೳΛ৭ʑऔΓἧ͍͑ͯΔ

  9. Kubernetesͷಛ௃

  10. Kubernetesͷಛ௃ • એݴܕͰ͋Δ • ࣗݾճ෮ੑ • ImmutableͰ͋Δ

  11. એݴܕͰ͋Δ

  12. એݴܕͰ͋Δɺͱ͸ • એݴܕ⁶खଓ͖ܕ • ঢ়ଶΛʮએݴʯ͢Δ • Kubernetes͸એݴ͞Εͨঢ়ଶʹۙ͘Α͏ಈ͘ ʢReconcile)

  13. એݴܕͱ͸

  14. ࣗݾճ෮ੑ

  15. Kubernetesͷࣗݾճ෮ੑ • એݴܕͰ͋Δɺ͜ͱͷ݁ՌͰ΋͋Δ • ๬Ήঢ়ଶΛએݴ͓ͯ͘͠ͱɺ్தͰো֐͕ى͖ ͯ΋ԿΛ͢Ε͹͍͍͔͸Kubernetes͕উखʹ ൑அ͢Δ • खଓ͖ܕ͸A→B→Cͷ్தͰো֐͕ى͖ͨΒ ࠶։͢Δͱ͜Ζ͔Βࢦࣔ͠ͳ͚Ε͹͍͚ͳ͍

  16. DeploymentͰ࡞੒ͨ͠PodΛফ͢

  17. Immutable

  18. ैདྷͷΠϯϑϥ • αʔόʔΛ্ཱͪ͛ɺ౎౓ιϑτ΢ΣΞΛΞο ϓσʔτ͢Δӡ༻ͩͬͨ • ৭ʑͳਓ͕ӡ༻ʹؔΘΓɺஈʑԿ͕Ͳ͏ͳͬ ͍ͯΔ͔Θ͔Βͳ͘ͳ͍ͬͯ͘

  19. ImmutableͳγεςϜ • ຖճ৽͘͠αʔόʔΛ࡞Δ • ৽نίϯςφΠϝʔδΛݩʹίϯςφΛ࡞ Γ௚͢

  20. Kubernetesͷ ΞʔΩςΫνϟʔ

  21. ਤࢀরɿIUUQTCMPHIFQUJPDPNDPSFLVCFSOFUFTKB[[JNQSPWPWFSPSDIFTUSBUJPOBFBDB

  22. Ϧιʔεͷઆ໌

  23. Kubernetesͷ୅දతϦιʔε • Node • Pod • Deployment • Service

  24. Node • ίϯςφΛσϓϩΠ͢Δαʔόʔ • ෺ཧɺԾ૝໰Θͳ͍

  25. Pod • KubernetesͰσϓϩΠ͢Δ୯Ґ • Ϋδϥͷ܈ΕΛPodͱ͍͏ • Podʹ͸ෳ਺ίϯςφ৐ͤΔ͜ͱ͕Ͱ͖Δ

  26. Deployment • ࢦఆͨ͠Podͷ਺Λҡ࣋͠ଓ͚ΔͨΊͷ ReplicaSetΛ؅ཧ͢Δ • ReplicaSetΛ࡞੒͢Δ͜ͱ΋Ͱ͖Δ͕ɺجຊ DeploymentΛར༻͢Δ • ϩʔϧόοΫ΍ϩʔϦϯάΞοϓσʔτʹର Ԡ

  27. Service • Pod֎͔ΒPodʹΞΫηε͢ΔͨΊʹར༻͢Δ Ϧιʔε

  28. ࢀߟࢿྉ

  29. ϦϯΫ • Kubectl cheat sheet • https://kubernetes.io/docs/reference/kubectl/cheatsheet/