Slide 1

Slide 1 text

Kubernetes Λ࢖ͬͨ σϓϩΠࣗಈԽج൫ @A(izu)LT ձ௡ฤ 0x02

Slide 2

Slide 2 text

$ whoami • ੨໦ଠ࿠ (@ktr_0731) • ρ s123 • Web • STEINS;GATEɺڹ͚ʂϢʔϑΥχΞϜ

Slide 3

Slide 3 text

؀ڥ • ਓ਺͕͋·Γଟ͘ͳ͍ձࣾ • WebɺαʔόɺϞόΠϧ͝ͱʹϦϙδτϦ͕ ෼͔Ε͍ͯΔ • खಈϏϧυɾσϓϩΠ

Slide 4

Slide 4 text

؀ڥ • ਓ਺͕͋·Γଟ͘ͳ͍ձࣾ • WebɺαʔόɺϞόΠϧ͝ͱʹϦϙδτϦ͕ ෼͔Ε͍ͯΔ • खಈϏϧυɾσϓϩΠ

Slide 5

Slide 5 text

؀ڥ • ਓ਺͕͋·Γଟ͘ͳ͍ձࣾ • WebɺαʔόɺϞόΠϧ͝ͱʹϦϙδτϦ͕ ෼͔Ε͍ͯΔ • खಈσϓϩΠ

Slide 6

Slide 6 text

ςετ؀ڥ΁ͷσϓϩΠ ʹ͕͔͔࣌ؒΔ

Slide 7

Slide 7 text

ςετ؀ڥ΁ͷσϓϩΠ ʹ͕͔͔࣌ؒΔ ↓ ࣗಈԽͷඞཁੑ

Slide 8

Slide 8 text

ཁૉ • Slack Bot • CI αʔό • Docker • Kubernetes

Slide 9

Slide 9 text

Docker • (େࡶ೺ʹ͍͏ͱ) ؀ڥΛίϯςφԽ͢Δٕज़ • Docker ΠϝʔδʹΞϓϦέʔγϣϯΛೖΕͯ ଞʹґଘΛٴ΅ͣ͞ʹಈ͔ͤΔ • Immutable Infrastructure

Slide 10

Slide 10 text

• a.k.a. k8s • Docker ίϯςφͷΦʔέετϨʔγϣϯπʔϧ • ΫϥελϦϯά • ίϯςφ܈ͷىಈɺఀࢭɺϨϓϦέʔγϣϯ

Slide 11

Slide 11 text

• 1ͭҎ্ͷ Docker Πϝʔδ͔Β Pod Λ࡞੒ • ֤ Node ʹ෼ࢄͯ͠഑ஔ

Slide 12

Slide 12 text

• namespace Ͱ؀ڥΛ෼͚Δ͜ͱ͕Ͱ͖Δ • Ͳͷ؀ڥʹσϓϩΠ͢Δ͔ߟ͑Δඞཁ͕ͳ͍

Slide 13

Slide 13 text

• namespace Ͱ؀ڥΛ෼͚Δ͜ͱ͕Ͱ͖Δ • Ͳͷ؀ڥʹσϓϩΠ͢Δ͔ߟ͑Δඞཁ͕ͳ͍ • Ͳ͜Ͱಈ͍͍ͯΔ͔ߟ͑ͳͯ͘ྑ͍

Slide 14

Slide 14 text

• namespace Ͱ؀ڥΛ෼͚Δ͜ͱ͕Ͱ͖Δ • Ͳͷ؀ڥʹσϓϩΠ͢Δ͔ߟ͑Δඞཁ͕ͳ͍ • Ͳ͜Ͱಈ͍͍ͯΔ͔ߟ͑ͳͯ͘ྑ͍ • Ͳ͏ಈ͍͍ͯΔ͔͚ͩߟ͑Ε͹ྑ͍

Slide 15

Slide 15 text

αʔϏεͷެ։ apiVersion: v1 kind: Service metadata: name: sample-server labels: name: sample-server spec: type: LoadBalancer ports: - port: 80 protocol: TCP targetPort: 8080 selector: name: sample-server

Slide 16

Slide 16 text

αʔϏεͷެ։ • type=LoadBalancer Ͱ LB ͕࡞੒͞ΕɺΞϓ Ϧέʔγϣϯ͕ެ։͞ΕΔ • AWS ͳͲͷαϙʔτ͞ΕͨҰ෦ͷΈ • kubernetes/ingress

Slide 17

Slide 17 text

σϓϩΠʹඞཁͳઃఆϑΝΠϧ • service.yaml (͖ͬ͞ͷઃఆ) • deployment.yaml • ϨϓϦΧ਺ͷࢦఆ • Pod ͷߏ੒ͷهड़

Slide 18

Slide 18 text

$ kubectl create -n test -f service.yaml $ kubectl create -n test -f deployment.yaml

Slide 19

Slide 19 text

ཁૉ • Slack Bot • CI αʔό • Docker • Kubernetes

Slide 20

Slide 20 text

Slack Bot • ChatOps • ୭Ͱ΋ςετ؀ڥʹσϓϩΠ͕Ͱ͖Δ

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Ұ࿈ͷྲྀΕ • Bot ʹσϓϩΠΛ఻͑Δ • CI ͕σϓϩΠϞʔυͰಈ͘ • CI ্Ͱ Kubernetes ΁ͷσϓϩΠεΫϦϓτ Λ࣮ߦ • σϓϩΠ׬ྃ

Slide 23

Slide 23 text

Ұ࿈ͷྲྀΕ • Bot ʹσϓϩΠΛ఻͑Δ • CI ͕σϓϩΠϞʔυͰಈ͘ • CI ্Ͱ Kubernetes ΁ͷσϓϩΠεΫϦϓτ Λ࣮ߦ • σϓϩΠ׬ྃ

Slide 24

Slide 24 text

՝୊ • ݱࡏ͸ςετ؀ڥͷΈͷ࢖༻ • ͍ͣΕϓϩμΫγϣϯ؀ڥͰ΋࢖͍͍ͨ • ஌ݟ͕ཷ·͍ͬͯͳ͍ • k8s ͷجຊ֓೦͸஌Δඞཁ͕͋Δ

Slide 25

Slide 25 text

·ͱΊ • Kubernetes • ෳ਺ͷಠཱͨ͠؀ڥΛ࡞੒Ͱ͖Δ • Ͳ͜Ͱಈ͍͍ͯΔ͔Λߟ͑ͣʹࡁΉ • k8s ͰσϓϩΠ͕ࣗಈͰͰ͖ΔΑ͏ʹͳͬͨ

Slide 26

Slide 26 text

ࢀߟ • https://speakerdeck.com/koudaiii/number- devsumie • Wantedly TechBook #2

Slide 27

Slide 27 text

Thanks for your attention!