Slide 1

Slide 1 text

CloudNative BuildpacksͰ૑Δɺ CloudNativeͳ։ൃମݧ ʙౙͷݰքṗͰͱΕͨɺ͍͖ͷ͍͍αόͷιςʔʹय़෩Λఴ͑ͯʙ

Slide 2

Slide 2 text

ࢁԼ࿨඙!QZBNB (.0ϖύϘٕज़ج൫νʔϜ γχΞɾϓϦϯγύϧ UFOTOBQPODPN QZBNBGVO TUOTKQ

Slide 3

Slide 3 text

45/4 -JOVY/444FSWFS TUOTKQ

Slide 4

Slide 4 text

45/4

Slide 5

Slide 5 text

޷͖ͳίϚϯυ perf record --call-graph dwarf -p

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

ࠓ೔࿩͢͜ͱ • ϖύϘͷϗεςΟϯάࣄۀʹ͓͚Δ։ൃ؀ڥͷ՝୊ • CloudNativeBuildPacksΛར༻ͨ͠ίϯςφΠϝʔδͷ࡞੒ • tecktoncd/pipelineΛ༻͍ͨίϯςφϏϧυύΠϓϥΠϯ • TelepresenceΛར༻ͨ͠ϦϞʔτ։ൃ؀ڥ • όνΣϥʔ3ΛݟऴΘͬͨײ૝ɺਅ࣮ͷѪͱ͸ʁ

Slide 9

Slide 9 text

ϖύϘͷ։ൃ؀ڥʹ͓͚Δ՝୊

Slide 10

Slide 10 text

։ൃ૊৫ αʔϏε ΤϯδχΞ σβΠφʔ ϓϩμΫτνʔϜ ϜʔνʔϜ σβΠφʔνʔϜ σβΠφʔνʔϜ͸αʔϏεԣஅ

Slide 11

Slide 11 text

։ൃ؀ڥ XXX VTFS BQJ

Slide 12

Slide 12 text

ྺ࢙ • ϩϦϙοϓʂϨϯλϧαʔόαʔϏε͸ࠓ೥18೥໨ • PHPxʙPHP7·Ͱ͕ݱଘ • JSͷύοέʔδ΋࣌୅ʹԠͨ͡΋ͷ͕ͦΕͳΓʹϚτϦΫεతʹଘࡏ

Slide 13

Slide 13 text

Կ΋ͯ͠ͳ͍ͷʹյΕΔ࣌୅͔Β Կ΋ͯ͠ͳ͍͔ΒյΕΔͷ࣌୅΁

Slide 14

Slide 14 text

ʮٱ͠ͿΓʹϜʔϜʔͷ
 σβΠϯ΍Δͧʙʯ

Slide 15

Slide 15 text

@muu-dev ։ൃ؀ڥ͕ ىಈ͠ͳ͘ͳΓ·ͨ͠ɻ͓࣌ؒ͋Δͱ͖ʹ ϔϧϓ͓ئ͍͠·͢ʙ

Slide 16

Slide 16 text

ׂΓࠐΈ࣌ؒɺ
 ϔϧϓͷ଴ͪ࣌ؒΛͳΜͱ͔͍ͨ͠

Slide 17

Slide 17 text

Kubernetesͬͯศརͬͯฉ͖·ͨ͠ XXX VTFS BQJ ࣗݾम෮͞Εͯɺએݴత͔ͭෆมతͳ։ൃ؀ڥͬͯ ͜ΕɺເͰ͔͢ʁເʁເ͡Όͳ͍ʁ

Slide 18

Slide 18 text

։ൃऀ͝ͱʹɺCloudNativeͳ։ൃ؀ڥΛ࡞Δ

Slide 19

Slide 19 text

–https://github.com/cncf/toc/blob/master/ DEFINITION.md#%E6%97%A5%E6%9C%AC%E8%AA%9E%E7%89%88 “Ϋϥ΢υωΠςΟϒٕज़͸ɺύϒϦοΫΫϥ΢υɺϓϥΠϕʔτΫϥ΢υɺϋΠϒϦουΫϥ΢υ ͳͲͷۙ୅తͰμΠφϛοΫͳ؀ڥʹ͓͍ͯɺεέʔϥϒϧͳΞϓϦέʔγϣϯΛߏங͓Αͼ࣮ߦ͢ ΔͨΊͷೳྗΛ૊৫ʹ΋ͨΒ͠·͢ɻ ͜ͷΞϓϩʔνͷ୅දྫʹɺίϯςφɺαʔϏεϝογϡɺϚΠΫϩαʔϏεɺΠϛϡʔλϒϧΠϯ ϑϥετϥΫνϟɺ͓ΑͼએݴܕAPI͕͋Γ·͢ɻ ͜ΕΒͷख๏ʹΑΓɺճ෮ੑɺ؅ཧྗɺ͓ΑͼՄ؍ଌੑͷ͋Δૄ݁߹γεςϜ͕࣮ݱ͠·͢ɻ ͜ΕΒ Λݎ࿚ͳࣗಈԽͱ૊Έ߹ΘͤΔ͜ͱͰɺΤϯδχΞ͸ΠϯύΫτͷ͋ΔมߋΛ࠷খݶͷ࿑ྗͰසൟ͔ ͭ༧ଌͲ͓Γʹߦ͏͜ͱ͕Ͱ͖·͢ɻ Cloud Native Computing Foundation͸ɺΦʔϓϯιʔεͰϕϯμʔதཱϓϩδΣΫτͷΤίγες ϜΛҭ੒ɾҡ࣋ͯ͠ɺ͜ͷύϥμΠϜͷ࠾༻Λଅਐ͍ͨ͠ͱߟ͑ͯ·͢ɻ ࢲͨͪ͸࠷ઌ୺ͷύλʔϯ ΛຽओԽ͠ɺ͜ΕΒͷΠϊϕʔγϣϯΛ୭΋͕ར༻Ͱ͖ΔΑ͏ʹ͠·͢ɻ” CloudNative != kubernetes

Slide 20

Slide 20 text

ιϦϡʔγϣϯ • CloundNativeBuildpacksͰԣஅతͳίϯςφϏϧυΛఏڙ͢Δ • tecktoncd/pipelineͰৗʹmasterͳঢ়ଶͳίϯςφΠϝʔδΛ࡞੒ • ingressɺexternal-dnsɺcert-managerΛར༻ͯ͠։ൃऀ͝ͱͷ։ൃ؀ڥΛ ࡞Δ • TelepresenceΛར༻ͯ͠ɺΫϥ΢υ্ͷϦιʔεͱڠಇͰ͖Δ։ൃ؀ڥͷ ࣮ݱ

Slide 21

Slide 21 text

ιϦϡʔγϣϯ • CloundNativeBuildpacksͰԣஅతͳίϯςφϏϧυΛఏڙ͢Δ • tecktoncd/pipelineͰৗʹmasterͳঢ়ଶͳίϯςφΠϝʔδΛ࡞੒ • ingressɺexternal-dnsɺcert-managerΛར༻ͯ͠։ൃऀ͝ͱͷ։ൃ؀ڥΛ ࡞Δ • TelepresenceΛར༻ͯ͠ɺΫϥ΢υ্ͷϦιʔεͱڠಇͰ͖Δ։ൃ؀ڥͷ ࣮ݱ

Slide 22

Slide 22 text

CloudNativeBuildpacks

Slide 23

Slide 23 text

Buildpack • heroku΍CloudFoundryͰ։ൃ͞Ε͖ͯͨίϯςφ
 Ϗϧυͷ࢓૊Έ • ΞϓϦέʔγϣϯίʔυΛݩʹίϯςφΠϝʔδΛੜ੒ • ྫ:composer.json͕͋Ε͹PHPΛΠϯετʔϧ͢Δ

Slide 24

Slide 24 text

Buildpack with heroku https://jp.heroku.com/elements/buildpacks

Slide 25

Slide 25 text

#VJME1BDLͷ՝୊ IFSPLV΍$MPVE'PVOESZͷ࣮૷Ͱ ૬ޓʹඍົʹಈ͔ͳ͍͜ͱ͕͋Δ

Slide 26

Slide 26 text

CloudNative Buildpacks(CNB) • 2018೥ʹPivotalͱherokuʹΑͬͯ։࢝ • CNCF CloudNative Sandbox΁௥Ճ • ݱঢ়͸Version̏ͷSpec͕ϦϦʔε͞Ε͍ͯΔ • ඪ४Խ͞ΕͨSpecʹج͖ͮOCIΠϝʔδΛ࡞੒Մೳ

Slide 27

Slide 27 text

Ϗϧυͷ࣮ߦ֓ཁ CNBͷू߹ମͱ΋ݴ͑ΔɺϏϧυ༻ͷΠϝʔδΛ࡞੒͠ɺίϯςφΠϝʔ δΛϏϧυ͢Δ builder image PHP-CNB Ruby-CNB RubyͷϦϙδτϦ Ruby࣮ߦ
 Πϝʔδ͕ ര஀

Slide 28

Slide 28 text

CNBΛ༻͍ͨίϯςφϏϧυ PSHBQJ QIQ PSHXXX 1)1 PSHJOGSB 1)1 PSHCMPH 1)1 % pack build --builder xxxx/tech-php-builder:0.0.1 ΞϓϦέʔγϣϯίʔυͷϦϙδτϦͰίϚϯυΛଧ͚ͭͩͰ ͦͷΞϓϦέʔγϣϯ͕ಈ͘ίϯςφΠϝʔδ͕ੜ੒͞ΕΔ

Slide 29

Slide 29 text

CNBͷ࣮૷֓ཁ Ruby-CNB detect build RubyΛΠϯετʔϧ͢Δ͔ʁ όʔδϣϯ͸ͳʹ͔ʁ ґଘؔ܎͸ͳʹ͔ʁ detect࣌ʹऔಘͨ͠৘ใΛݩʹ RubyΛίϯύΠϧͨ͠ΓGemΛೖΕͨΓ

Slide 30

Slide 30 text

detect • CNB͝ͱʹdetect͕ίʔϧ͞ΕΔ • ऴྃίʔυͰ͜ͷCNBΛར༻͢Δ͔Ͳ͏͔ Λޙଓͷbuild΁఻ൖ͢Δ • ޙଓ΁ͷґଘؔ܎ͷఆٛ͸ YAML #!/bin/sh if [ -f Gemfile ]; then echo "Ruby Buildpack" exit 0 else exit 1 fi

Slide 31

Slide 31 text

build #!/bin/sh apt install ruby if [ $openssl = "1.1" ]then; apt install opnessl-1.1 else apt install openssl fi bundle install • detectϑΣʔζͰར༻͢Δͱ൑ఆ͞Εͨ CNBͷbuild͕ݺͼग़͞ΕΔ • buildϑΣʔζͰ͸ίϯςφʹඞཁͳࢿ࢈ͷ ΠϯετʔϧͳͲΛϓϥΨϒϧʹఆٛ͢Δ ͜ͱ͕Ͱ͖Δ

Slide 32

Slide 32 text

CNBͷ࣮ߦ֓ཁ ruby-cnb bin/detect bin/build php-cnb bin/detect bin/build node-cnb bin/detect bin/build lifecycle Ruby͸Πϯετʔϧ͢Δʁ PHPίϯύΠϧ͠·͢Ͷ lifecycleͱ͍͏CNBͷSpec࣮૷͕ɺͦΕͧΕͷCNBͷґଘղܾΛ ͠ͳ͕ΒͦΕͧΕͷϑΣʔζΛ࣮ߦ

Slide 33

Slide 33 text

CNBͷ։ൃ • ϝΠϯͷ։ൃݴޠ͸Golang • ݴޠܥͷCNB͸CloudFoundry͕ଟ͘OSSԽ͓ͯ͠Γɺࣗ෼Ͱ࣮૷͢Δ͜ ͱ͸ຆͲͳ͍ • طଘCNBΛ૊Έ߹ΘͤΔ͚ͩͰɺ΄ͱΜͲͷΠϝʔδ͸࡞ΕΔ

Slide 34

Slide 34 text

Dockerfileͱͷҧ͍

Slide 35

Slide 35 text

DockerfileͱCNBͷൺֱ • SecurityFixͳͲͷରԠ • ҙࢥܾఆͷλΠϛϯάͷҧ͍ʹΑΔӡ༻ͷॊೈੑ

Slide 36

Slide 36 text

SecurityFix Dockerfile CNB w#VJME*NBHFΛߋ৽͢Δ w%PDLFSpMF͝ͱʹؤுΔ w#BTF*NBHFΛఆٛ͢Δ

Slide 37

Slide 37 text

ࢄࡏ͕ͪ͠ͳDockerfile PSHBQJ %PDLFSpMF PSHXXX %PDLFSpMF PSHJOGSB %PDLFSpMF PSHVTFS %PDLFSpMF PSHCMPH %PDLFSpMF ͢΂ͯͷ%PDLFSpMFͷߋ৽ٴͼɺ
 ࣮ଶ֬ೝ͕ඞཁ

Slide 38

Slide 38 text

CNBΛ༻͍ͨίϯςφϏϧυ(࠶ܝ) PSHBQJ QIQ PSHXXX 1)1 PSHJOGSB 1)1 PSHCMPH 1)1 % pack build --builder xxxx/tech-php-builder:0.0.1 Ϗϧυ༻ͷϓϩάϥϜ CVJMEFSJNBHF Λߋ৽ͯ͠΍Ε͹ ͋ͱ͸͢΂ͯϓϥΨϒϧʹॲཧ͞ΕΔ

Slide 39

Slide 39 text

ҙࢥܾఆλΠϛϯά͕ܾఆతʹҧ͏ Dockerfile CNB DockerfileʹOpenSSL1.0Λ࢖͏ͱॻ͘ docker build ※ CNBʹɺ؀ڥʹΑͬͯOpenSSL1.1ɺ1.0Λ ࢖͏ίʔυΛॻ͘ pack buid OpenSSL 1.0Λ࢖͏Πϝʔδര஀ OpenSSL 1.1ɺ1.0ͷར༻͕ΞϓϦέʔγϣ ϯίʔυΛج४ͱͨ͠ͰҙࢥܾఆʹΑͬͯ બ͹Εͨϝʔδര஀ ※ɹϏϧυ࣌ʹ؀ڥม਺ͳͲͰڍಈΛมߋ͢Δ͜ͱ͸΍Ζ͏ͱࢥ͑͹Ͱ͖Δ

Slide 40

Slide 40 text

Dockerfile΋CNB΋͍ͣΕ΋ એݴతͰ͸͋Δ͕ɺCNBͷ΄͏͕ ΑΓॊೈʹίϯςφϏϧυΛߦ͑Δ͠ ந৅౓ͷߴ͍࣮૷͕ϝϯςφϯε͠΍͍͢ܗͰ ࣮૷Ͱ͖Δ

Slide 41

Slide 41 text

ΞϓϦέʔγϣϯΛݩʹΠϝʔδ࡞ΕΔ ͳΒ͹ɺΞϓϦέʔγϣϯ͕ มߋ͞ΕͨΒࣗಈͰΠϝʔδ࡞Ε͍ͨ

Slide 42

Slide 42 text

ιϦϡʔγϣϯ • CloundNativeBuildpacksͰԣஅతͳίϯςφϏϧυΛఏڙ͢Δ • tecktoncd/pipelineͰৗʹmasterͳঢ়ଶͳίϯςφΠϝʔδΛ࡞੒ • ingressɺexternal-dnsɺcert-managerΛར༻ͯ͠։ൃऀ͝ͱͷ։ൃ؀ڥΛ ࡞Δ • TelepresenceΛར༻ͯ͠ɺΫϥ΢υ্ͷϦιʔεͱڠಇͰ͖Δ։ൃ؀ڥͷ ࣮ݱ

Slide 43

Slide 43 text

tecktoncd/pipeline • knative/buildͷਖ਼ࣜͳޙଓϓϩδΣΫτ • k8s্ͰύΠϓϥΠϯΛએݴతͳύΠϓϥΠϯΛ࣮ߦ • ެ։͞Ε͍ͯΔϨγϐ΋๛෋

Slide 44

Slide 44 text

tecktoncd/catalogʹ͍Ζ͍Ζͳαϯϓϧ͕͋Δ

Slide 45

Slide 45 text

tecktoncd/pipeline֓ཁ Pipeline1 Task1 Task2 Task3 Pipeline2 Task4 Task5 Task6 Pipeline Run parameter parameter Task͝ͱʹΞ΢τϓοτΛ ޙଓʹҾ͖౉ͤΔ 5BTLɺ1JQFMJOFͱҙຯͷ͋Δ୯ҐͰϦιʔεΛఆٛՄೳ ͦΕʹΑΓ࠶ར༻Ͱ͖ΔύΠϓϥΠϯ͕࣮ݱͰ͖Δ

Slide 46

Slide 46 text

CNDύΠϓϥΠϯ Task1 ΞϓϦέʔγϣϯΛݩʹɺ
 ࠷৽ͷΠϝʔδΛϏϧυͯ͠ Private Repo΁push Task2 ࠷৽ͷΠϝʔδΛk8sʹ
 σϓϩΠ͢Δ Pipeline Run parameter parameter repository: lolipop/www image: lolipop-www commit_hash: xxxxxxxx ϦϙδτϦ͕૿͑ͯ΋ɺ1JQFMJOF3VOΛ௥Ճ͢Δ͚ͩͰ ࠷৽ͷΠϝʔδ͕࡞੒͞ΕΔ

Slide 47

Slide 47 text

Argo CDΛ༻͍ͨύΠϓϥΠϯ࣮ߦ • GitOpsͳϫʔΫϑϩʔΛ࣮ݱ͢ΔCDιϑτ΢ΣΞ • GitHubͳͲͷ։ൃϓϥοτϑΥʔϜΛ؂ࢹ͠ɺࠩ෼͕͋Ε͹ఆΊΒΕͨ
 ఆٛʹج͍ͮͯσϓϩΠ • σϓϩΠ͸helm,kustomize,ksonnetͳͲͰఆ͕ٛՄೳ • ϦϙδτϦͷࠩ෼͕͋Ε͹ݕ஌ͯࣗ͠ಈͰऩଋ • CI/CDΛ෼཭͢Δ͜ͱͰɺCI͕ංେʹͳΔͷΛආ͚Δ

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

Argo CDͷpluginػߏΛར༻͢Δ • Argo CD͸ϚχϑΣετΛσϓϩΠ͢Δͱ͍͏ػೳΛఏڙ • ϓϥάΠϯΛར༻͢Δ͜ͱͰϚχϑΣετͷద༻લʹॲཧΛհࡏͤ͞Δ͜ ͱ͕Ͱ͖Δ • ϓϥάΠϯΛద༻લʹGitͷCommit hashΛϚχϑΣετʹؚΉॲཧΛ
 ௥Ճ͢Δ

Slide 50

Slide 50 text

ͳͥ͜ͷΑ͏ͳ͜ͱ͕
 ඞཁͳͷ͔ʁ

Slide 51

Slide 51 text

k8sͰ͋Δ͕Ώ͑ඞཁ • k8s͸એݴతͳϦιʔεఆٛʹج͖ͮऩଋ͢Δ • PipelineϦιʔεͷมԽ͕ͳ͍৔߹ɺPipeline͕࣮ߦ͞Εͳ͍
 →Pipelineͷ໊લ΍Image໊ʹGitͷCommit hashΛຒΊࠐΜͰ࣮ߦͤ͞Δ

Slide 52

Slide 52 text

͜͜·Ͱͷ·ͱΊ NBTUFSNFSHF BQQMZNBOJGFTU QPMMJOH CVJMEQVTIEFQMPZ

Slide 53

Slide 53 text

ιϦϡʔγϣϯ • CloundNativeBuildpacksͰԣஅతͳίϯςφϏϧυΛఏڙ͢Δ • tecktoncd/pipelineͰৗʹmasterͳঢ়ଶͳίϯςφΠϝʔδΛ࡞੒ • ingressɺexternal-dnsɺcert-managerΛར༻ͯ͠։ൃऀ͝ͱͷ։ൃ ؀ڥΛ࡞Δ • TelepresenceΛར༻ͯ͠ɺΫϥ΢υ্ͷϦιʔεͱڠಇͰ͖Δ։ൃ؀ڥͷ ࣮ݱ

Slide 54

Slide 54 text

inside k8s k8s pod service ingress The internet pod service pod service each user • Ϣʔβʔ͝ͱͷϦιʔε͸ɺKustomizeΛར ༻ͯ͠ஔ׵ͯ͠deploymentsΛapply • ໊લղܾʹ͸external dnsΛར༻ • ূ໌ॻͷൃߦ͸cert-managerΛར༻ • ingressʹPublicIPΛ෇༩͠ɺ֎෦͔ΒͷΞ ΫηεੑΛ֬อ ip

Slide 55

Slide 55 text

external-dns --- apiVersion: v1 kind: Service metadata: annotations: external-dns.alpha.kubernetes.io/hostname: lolipop-www.example.dev service Any Backend https://github.com/kubernetes-sigs/external-dns external-dns-controller

Slide 56

Slide 56 text

cert-manager https://github.com/jetstack/cert-manager cert-manager-controller Any DNS Backend Certificate challenge ূ໌ॻͷߋ৽΋ࣗಈͰߦͬͯ͘ΕΔͷͰ %/4ͱ૊Έ߹ΘͤΔͱϚωʔδυϫΠϧυΧʔυূ໌ॻ͕ൃߦͰ͖Δ

Slide 57

Slide 57 text

cert-manager --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: nginx-ingress-controller spec: [snip] containers: - args: - /nginx-ingress-controller - "--default-backend-service=$(POD_NAMESPACE)/default-http-backend" - "--default-ssl-certificate=$(POD_NAMESPACE)/cert-wildcard" OHJOYJOHSFTTͷҾ਺ʹอଘͨ͠4FDSFU໊Λ ౉͢͜ͱͰূ໌ॻΛར༻Մೳ

Slide 58

Slide 58 text

طଘ։ൃ؀ڥͱͷซଘ ࣗࣾαʔόϧʔϜʹ%#ͳͲͷڞ༗Ϧιʔε͕Ұ෦ଘࡏ͢ΔͨΊ /HJOYͷ-ϓϩΩγ71/Ͱซଘ pod pod Nginx VPN طଘ؀ڥ

Slide 59

Slide 59 text

Ϣʔβʔ͝ͱͷ։ൃ؀ڥ • ৗʹ࠷৽ͷmaster͕σϓϩΠ͞ΕΔ • HTTPSͰ҉߸Խ • k8s্Ͱಈ͘ͷͰࣗݾम෮

Slide 60

Slide 60 text

ιϦϡʔγϣϯ • CloundNativeBuildpacksͰԣஅతͳίϯςφϏϧυΛఏڙ͢Δ • tecktoncd/pipelineͰৗʹmasterͳঢ়ଶͳίϯςφΠϝʔδΛ࡞੒ • ingressɺexternal-dnsɺcert-managerΛར༻ͯ͠։ൃऀ͝ͱͷ։ൃ؀ڥΛ ࡞Δ • TelepresenceΛར༻ͯ͠ɺΫϥ΢υ্ͷϦιʔεͱڠಇͰ͖Δ։ൃ؀ ڥͷ࣮ݱ

Slide 61

Slide 61 text

Telepresence XXX VTFS BQJ VTFS ඞཁͳαʔϏε͚ͩखݩͰىಈͯ͠ɺ ࢒Γ͸,VCFSOFUFTͷϦιʔεΛ࢖͏

Slide 62

Slide 62 text

Telepresence https://www.telepresence.io/ $ telepresence --swap-deployment hello-world --docker-run --rm -it -v $(pwd):/ usr/src/app hello-dev ίϚϯυҰͭͰखݩͷϓϩηεͱLTΛ ૒ํ޲ʹϙʔτϑΥϫʔυ͢Δ͜ͱ͕Ͱ͖Δ

Slide 63

Slide 63 text

ൃੜͨ͠ࣄ৅1 XXX VTFS BQJ VTFS 5FMFQSFTFODFΛڧ੍ऴྃ͢Δͱɺ ։ൃ؀ڥ͕ݟ͑ͳ͘ͳΔ

Slide 64

Slide 64 text

ൃੜͨ͠ࣄ৅2 XXX VTFS BQJ 5FMFQSFTFODFΛར༻தʹ ୭͔͕NBTUFSNFSHF͢ΔͱଟॏىಈʹͳΔ VTFS NBTUFS

Slide 65

Slide 65 text

ࣗݾम෮.sh #!/bin/bash set -x while true; do deployments=`kubectl -n example get deployment -o json | jq -r '.items[] | select(.spec.replicas == 0) | .metadata.name'` if [ -n "$deployments" ]; then echo "$deployments" | while read line do (curl -o /dev/null -s -w '%{http_code}\n' https://$line.example.dev |grep 502) && \ (kubectl -n example delete deployments $(kubectl -n example get deployments | grep "$line-" | awk '{print $1 }') && \ kubectl -n example scale deployment.apps/$line --replicas=1) done fi sleep 10 # ಉ͡deployments͕ෳ਺͋Δ͔ͭɺૄ௨ੑ͕͋ΔͳΒ͹ɺͦΕ͸telepresence࢖༻தʹmaster͕σϓϩΠ͞ΕͨՄೳੑ͕ߴ͍ deployments=`kubectl -n example get deployment -o json | jq -r '.items[] | select(.spec.replicas == 1) | .metadata.name' | sort` echo "$deployments" | while read line do ([ `echo "$deployments" | grep $line | wc -l` -ge 2 ] && !(curl -o /dev/null -s -w '%{http_code}\n' https:// $line.example.dev |grep 502)) && \ kubectl -n example scale deployment.apps/$line --replicas=0 done done

Slide 66

Slide 66 text

։ൃ؀ڥΛࢧ͑Δཁૉ • HashiCorp VaultʹΑΔൿಗ৘ใ؅ཧ • ݖݶ؅ཧ͸GitHub EnterpriseΛόοΫΤϯυʹར༻

Slide 67

Slide 67 text

։ൃ؀ڥΛk8sʹҠߦ͢Δҙٛ • VM to Container͸ඞͣ͠΋༏ઌ౓ߴ͘΍Δ΂͖࡞ۀͰ͸ͳ͍έʔε΋ԟʑ ʹͯ͋͠Δ • k8s͸ΠϯϑϥʹҰͭͷந৅ϨΠϠʔͱͯ͠ࠓޙଘࡏ͠ଓ͚ΔՄೳੑ͕ߴ ͘ɺٕज़తͳΩϟονΞοϓ͸ඞਢ • ։ൃऀɺσβΠφʔ͕Ұ൪ଟ͘৮ΕΔ։ൃ؀ڥΛk8sʹ͢Δ͜ͱͰٕज़త ͳΩϟονΞοϓΛͭͭ͠ɺ։ൃ؀ڥ͕ރΕΕ͹ɺࣗવͱຊ൪Ҡߦ͠΍͢ ͘ͳΔ

Slide 68

Slide 68 text

ࠓ೔࿩ͨ͜͠ͱ • طଘͷෳ਺ͷݴޠόʔδϣϯΛ๊͑ΔϖύϘʹ͸CNBʹΑΔϓϥΨϒϧͳ ίϯςφϏϧυ͕దԠͨ͠ • tecktoncd/pipelineΛར༻͢Δ͜ͱͰɺk8s nativeͳίϯςφϏϧυ͕࣮ݱ Ͱ͖Δ • telepresenceΛ༻͍ΔͱϩʔΧϧ։ൃ؀ڥͱk8sΛγʔϜϨεʹѻ͑Δ • όνΣϥʔ3ͷ࠷ޙల։ʹԶ͸ೲಘ͍ͯ͠ͳ͍

Slide 69

Slide 69 text

ँࣙ • ͜ͷࢿྉͰड़΂ͨ։ൃ؀ڥΛࣄۀ෦ͷϝϯόʔʹల։͢Δʹ౰ͨΓɺಉ྅ ͷ@takumakume͞Μ͕ڧ͘ਚྗͯ͘͠Ε·ͨ͠ • ϖύϘͷΦϯϓϨk8sͷ։ൃΛ΄΅ҰਓͰϦʔυͯ͘͠ΕΔ@r_takaishiʹ ͸಄্͕͕Γ·ͤΜ

Slide 70

Slide 70 text

Thanks @hiboma @zipper @kenchan

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

࠷৽ͷ࠾༻৘ใΛνΣοΫˠ !QC@SFDSVJU Ұॹʹ/BUJWF&OHMJTIʹͳΒͳ͍͔ʁ