Slide 1

Slide 1 text

Kubernetes ϋϯζΦϯ

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

Kubernetesͱ͸

Slide 4

Slide 4 text

…ͷલʹ

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

͜ΕΒΛ KubernetesͰ ղܾʂ

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Kubernetesͷಛ௃

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

એݴܕͰ͋Δ

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

એݴܕͱ͸

Slide 14

Slide 14 text

ࣗݾճ෮ੑ

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

DeploymentͰ࡞੒ͨ͠PodΛফ͢

Slide 17

Slide 17 text

Immutable

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

Kubernetesͷ ΞʔΩςΫνϟʔ

Slide 21

Slide 21 text

ਤࢀরɿIUUQTCMPHIFQUJPDPNDPSFLVCFSOFUFTKB[[JNQSPWPWFSPSDIFTUSBUJPOBFBDB

Slide 22

Slide 22 text

Ϧιʔεͷઆ໌

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

ࢀߟࢿྉ

Slide 29

Slide 29 text

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