Kubernetes を利用したデプロイ自動化基盤
by
ktr
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
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!