Slide 1

Slide 1 text

Japan Container Days v18.12 ίʔυΛॻ͘͜ͱʹूத͍ͨ͠શͯͷ ΞϓϦ։ൃऀʹଃΔKubernetesͷ࿩ Senior Architect Yoshiaki Mizukura SIOS Technology, Inc. Dec 5, 2018

Slide 2

Slide 2 text

2 αΠΦεςΫϊϩδʔגࣜձࣾ ٕज़2෦ ΞϓϦέʔγϣϯίϯαϧςΟϯάάϧʔϓ γχΞΞʔΩςΫτ ਫ૔ ྑ໌ About me • Ϋϥ΢υج൫த৺ͷΠϯϑϥߏங͔ΒΞϓϦ։ൃ • σʔλ෼ੳج൫ߏங • WebΞϓϦ։ൃʢΤϯλʔϓϥΠζܥʣ Powered by https://wordart.com/

Slide 3

Slide 3 text

3 • ΞϓϦ࣮ߦ؀ڥͷύοέʔδԽʹΑΔ؀ڥؒࠩҟͷۃখԽ • ίϯςφҎલɾɾɾ • ։ൃ؀ڥͰಈ͘ίʔυ͕ຊ൪؀ڥͰಈ͔ͳ͍ • ΞϓϦͱ࣮ߦ؀ڥͷߏ੒؅ཧͷ͠΍͢͞ • Immutableͳ࣮ߦ؀ڥʹΑΔႈ౳ੑͷ୲อ ։ൃऀʹͱͬͯͷίϯςφϝϦοτ͓͞Β͍ ΞϓϦ֎෦ͷ؀ڥґଘʹ೰·͞ΕΔ͜ͱ͕ݮΓɺਝ଎ͳσϦόϦ͕ՄೳʹͳΔ

Slide 4

Slide 4 text

4 ΑΓଟ͘ͷTry & Error͕ɺΑΓྑ͍݁ՌΛੜΈग़͢

Slide 5

Slide 5 text

5 ߏஙγεςϜ୯ҐͷมԽ γεςϜ͝ͱʹVMΛ࡞Δ γεςϜ͝ͱʹίϯςφΛ࡞Δ Ծ૝ج൫ H/W H/W H/W VM OS M/W App Ծ૝ج൫ H/W H/W H/W M/W App M/W App M/W App M/W App ίϯςφج൫ VM OS VM OS VM OS VM OS M/W App VM OS M/W App VM OS M/W App VM OS ैདྷͷΠϯϑϥ͕ΞϓϦͱηοτʹͳͬͨʢΠϯϑϥͱΞϓϦͷڥքมԽʣ VMʢඇίϯςφʣ ίϯςφ

Slide 6

Slide 6 text

6 ΠϯϑϥͱΞϓϦͷڥքมԽ Ծ૝ج൫ H/W H/W H/W M/W App M/W App M/W App M/W App ίϯςφج൫ VM OS VM OS VM OS VM OS ίϯςφߏ੒ఆٛ ΞϓϦʹՃ͑ͯϛυϧ΢ΣΞɺωοτϫʔΫɺετϨʔδߏ੒ͷཧղ σʔλӬଓԽ ωοτϫʔΫ Docker Compose Kubernetes ႈ౳ͳ࣮ߦ؀ڥΛखܰʹߏஙͰ͖ΔΑ͏ʹͳͬͨ

Slide 7

Slide 7 text

7 • ίϯςφͷϝϦοτ͸ཧղͰ͖Δ΋ͷͷɾɾɾ ΞϓϦ։ൃऀͷށ࿭͍ ͦ΋ͦ΋։ൃͷྲྀΕͲ͏ͳΔͷʁ Logging CI/CD HTTPηογϣϯ؅ཧ σϓϩΠ؀ڥͷࠩҟ ؂ࢹ ϚΠΫϩαʔϏε޲͖ͱ͸ฉ͚͘Ͳɾɾɾ ϦτϥΠ ෛՙ෼ࢄ ෼ࢄϩάͷτϨʔε ྲྀྔ੍ݶ αʔΩοτϒϨʔΧ ো֐ݕ஌ αʔϏεؒͷґଘؔ܎ ςετ

Slide 8

Slide 8 text

8 • WebΞϓϦ։ൃʹ͓͚Δ ʮίϯςφͩͱ͜ΕͬͯͲ͏͢ΔΜ͚ͩͬʯͷ੔ཧ • ίϯςφϕʔεͷΞϓϦ։ൃޮ཰UPπʔϧ঺հ (※) Docker/KubernetesΛલఏͱ͍ͯ͠·͢ɻ جຊతͳ֓೦ʹ͸৮Ε·ͤΜɻ Today’s Session

Slide 9

Slide 9 text

9 ίϯςφϕʔεͷΞϓϦ։ൃͷώϯτ Goal ʮίϯςφͩͱ΍΍͍͜͠ʯ͔Β ʮίϯςφ͔ͩΒͦ͜ίʔυʹूதͰ͖Δʯ΁

Slide 10

Slide 10 text

10 • ίϯςφͷϝϦοτ͸ཧղͰ͖Δ΋ͷͷɾɾɾ ΞϓϦ։ൃऀͷށ࿭͍ʢ࠶ܝʣ ͦ΋ͦ΋։ൃͷྲྀΕͲ͏ͳΔͷʁ Logging CI/CD HTTPηογϣϯ؅ཧ σϓϩΠ؀ڥͷࠩҟ ؂ࢹ ϚΠΫϩαʔϏε޲͖ͱ͸ฉ͚͘Ͳɾɾɾ ϦτϥΠ ෛՙ෼ࢄ ෼ࢄϩάͷτϨʔε ྲྀྔ੍ݶ αʔΩοτϒϨʔΧ ো֐ݕ஌ αʔϏεؒͷґଘؔ܎ ςετ

Slide 11

Slide 11 text

ίϯςφϕʔεΞϓϦ։ൃͷྲྀΕ

Slide 12

Slide 12 text

12 Delivery Pipeline base Image Image Coding Test Dockerfile /Manifest Release Legacy Container-based खॱॻ Param Sheet build & deploy Code M/W M/W APP खॱॻ Param Sheet Code Manifest Dockerfile ؀ڥߏங push ؀ڥߏங ؀ڥߏங ؀ڥߏங ؀ڥߏங build Image Registry Image Registry Code Repositry Code Repositry push pull push build push deploy deploy Manifest (for Test) Manifest (for Production) ؀ڥߏங build & deploy ҟͳΔ؀ڥ΁εϜʔζʹҠߦՄೳɻͲ͜Ͱ΋ͪΌΜͱಈ͘ΞϓϦ΁ Docker/Kubernetesͷ֓೦ɺؔ࿈CLIͷֶशίετ͸͔͔Δ (։ൃऀશһ͕શͯΛ೺Ѳ͢Δඞཁ͸ͳ͘ϙΠϯτ͸ߜΕΔ)

Slide 13

Slide 13 text

σϓϩΠ؀ڥࠩҟ΁ͷΞϓϩʔν

Slide 14

Slide 14 text

14 ઃఆϑΝΠϧ͕؀ڥม਺Λɾɾɾ • ಡΊΔ৔߹ • ManifestϑΝΠϧ͔ΒConfigMapΛࢀর͢Δ • ಡΊͳ͍৔߹ • ઃఆϑΝΠϧͷ௚઀ॻ͖׵͑ • ؀ڥຖͷઃఆϑΝΠϧͰ্ॻ͖ • ςϯϓϨʔτΤϯδϯͰ؀ڥม਺ΛຒΊࠐΉ σϓϩΠ؀ڥࠩҟ΁ͷΞϓϩʔν ίϯςφΠϝʔδʹ؀ڥґଘͷ৘ใΛอ࣋ͤͣɺ؀ڥม਺ʹ੾Γग़͢

Slide 15

Slide 15 text

15 • ઃఆ৘ใΛఆٛ͠ɺPodʹ౉ͤΔϦιʔε • Spring΍Rails౳ɺઃఆϑΝΠϧͰ؀ڥม਺ΛಡΈࠐΊΔͳ ΒConfigMap͕ద͍ͯ͠Δ • Pod΍DeploymentଆͰ؀ڥม਺Λ௚઀ఆٛ͢Δ͜ͱ΋Մೳɻ ϢʔεέʔεʹԠͯ͡બ୒ ConfigMap / -2 : C/ " :1 C 2 2: 2 /1/ / :/ 2 C / 2 2 2 / C 2 / 2 2 : / :2 :/ 2 C / 2 / 2 C 2 2: :/ 2 C . / 2 : / 2 2 :/ 2 C / 2 2: : 2 C 2 :/ 2 C . / 2 : / 2 2 :/ 2 C / 2 2: : 2 C 2 / -2 : C :1 C : / 2 /1/ / :/ 2 C / 2 2: : 1/ / 2 C / 2 C / ConfigMap DeploymentϦιʔε͔Βͷࢀরํ๏

Slide 16

Slide 16 text

16 • envFromͰConfigMapΛ·ͱΊͯࢀর͢Δ͜ͱ΋Մೳ ConfigMap Ωʔ໊ʹ؀ڥม਺໊Ͱఆٛ͢Δ / -2 : :1 : / 2 /1/ / :/ 2 / 2 2: : 1/ / . / . / ConfigMap / -2 : / " :1 2 2: 2 /1/ / :/ 2 / 2 2 2 / 2 / 2 2 : / :2 :/ 2 / 2 / 2 2 2: : / 2 :/ 2 / 2 2: : DeploymentϦιʔε͔Βͷࢀরํ๏

Slide 17

Slide 17 text

17 ઃఆϑΝΠϧ͕؀ڥม਺ΛಡΊͳ͍৔߹ ؀ڥม਺ΛಡΈࠐΊΔ͔Ͳ͏͔͸ιϑτ΢ΣΞͷ࣮૷ґଘ • ઃఆϑΝΠϧͷ௚઀ॻ͖׵͑ • ؀ڥຖͷઃఆϑΝΠϧͰ্ॻ͖ • ςϯϓϨʔτΤϯδϯͰ؀ڥม਺ΛຒΊࠐΉ

Slide 18

Slide 18 text

18 ઃఆϑΝΠϧͷ௚઀ॻ͖׵͑/্ॻ͖ entrypont.sh sedͰϑΝΠϧॻ͖׵͑ → ॻ͖׵͑ର৅͕ଟ͍ͱͭΒ͘ͳΔ ؀ڥຖͷઃఆϑΝΠϧͰ্ॻ͖ → ؀ڥຖʹઃఆϑΝΠϧΛ؅ཧ͢Δඞཁ͕͋Δ อकੑ͕௿͍

Slide 19

Slide 19 text

19 • ؀ڥม਺ΛຒΊࠐΊΔܰྔςϯϓϨʔτΤϯδϯ envsubst test.properties.tmpl >< = #> 1 . > 1 Template Engine envsubst $ . test.properties • ؀ڥม਺͸Deployment΍ConfigMapʹఆٛ • ίϯςφΠϝʔδଆͰenvsubstͯ͠ઃఆϑΝΠϧʹ؀ڥม਺ΛຒΊࠐΉ $ $ .

Slide 20

Slide 20 text

20 • ؀ڥґଘͷ৘ใ͸؀ڥม਺ʹ੾Γग़͢ • ΞϓϦɺM/Wଆ͸؀ڥม਺Λࢀর͢Δ • ઃఆϑΝΠϧ͕؀ڥม਺ͷಡࠐʹରԠ͍ͯ͠ͳ͍৔߹͸envsubstͳ ͲςϯϓϨʔτΤϯδϯΛ׆༻͢Δ σϓϩΠ؀ڥࠩҟ΁ͷରԠ·ͱΊ

Slide 21

Slide 21 text

Logging

Slide 22

Slide 22 text

22 Logging App Logger rotate ϥΠϒϥϦ΍ϑϨʔϜϫʔΫػೳΛར༻ ैདྷʢඇίϯςφʣ ίϯςφ ίϯςφΤϯδϯͷlogging driverΛར༻ Docker logging driver App App stdout/err stdout/err somewhere (log store) ΞϓϦ͔Β͸ඪ४/Τϥʔग़ྗ΁ϩάΛग़ྗ ϋϯυϦϯά͸logging driverʹ೚ͤΔ

Slide 23

Slide 23 text

23 ୅දతͳυϥΠό ػೳ json-file JSONܗࣜͰग़ྗʢσϑΥϧτʣ ϩʔςʔγϣϯ΋Մೳɻίϯςφ࡟আʹΑͬͯ࡟আ͞ΕΔɻ ϗετଆʹϑΝΠϧग़ྗ͞ΕΔɻ /var/lib/docker/containers/[container-id]/[container-id]-json.log syslog syslog (※) ΁ग़ྗ journald journald (※) ΁ग़ྗ fluentd fluentd (※) ΁ग़ྗ (forward input) awslog Amazon CloudWatch Logs΁ग़ྗ gcplogs Google Cloud Platform Logging΁ग़ྗ Docker logging driver (※) ίϯςφ͔Β઀ଓՄೳͳσʔϞϯ͕ඞཁ

Slide 24

Slide 24 text

24 • fluentd logging driverͰfluentd΁సૹ͠ɺElasticsearch΁ू໿ • kibanaͰՄࢹԽ ϩάू໿ˍՄࢹԽͷྫ (Docker) fluentd logging driver App App stdout/err stdout/err Docker store visualize Docker

Slide 25

Slide 25 text

25 • ίϯςφ͚ͩͰ͸ͳ͘k8sίϯϙʔωϯτͷϩά΋ؚΊͯfluentdͰू໿ • DaemonSetͰfluentdΛશϊʔυʹඞͣ1Podͣͭ഑ஔ • ֤k8sϦιʔεͷlabelΛద੾ʹઃఆ͓ͯ͘͜͠ͱͰɺElasticsearchͰͷݕࡧੑ޲্ • ϚΠΫϩαʔϏεͷ৔߹ɺαʔϏεϝογϡͷར༻΋ݕ౼ʢޙड़ʣ ϩάू໿ˍՄࢹԽͷྫ (k8s) store visualize logging driver App stdout/err logging driver App stdout/err (※) ؆ུԽͷͨΊIngress, Service, Pod͸লུ k8s Node Docker Engine k8s Node Docker Engine k8s Node ৄࡉ͸fluentdެࣜDaemonSetΛࢀর https://github.com/fluent/fluentd-kubernetes-daemonset

Slide 26

Slide 26 text

26 • ΞϓϦ͔Βͷϩά͸ϑΝΠϧग़ྗͰ͸ͳ͘શͯඪ४ग़ྗΛ࢖༻͢Δ • ϛυϧ΢ΣΞͷϩά΋ඪ४ग़ྗʹͯ͠ίϯςφΠϝʔδԽ͢Δ • Dockerͷlogging driver͸JSONܗࣜͱ͢Δ͜ͱͰଐੑͰͷݕࡧ͕͠ ΍͘͢ͳΔ • DeploymentͳͲk8sϦιʔεͷlabelΛద੾ʹઃఆ͢Δ͜ͱͰݕࡧੑ Λ޲্Ͱ͖Δ Logging·ͱΊ

Slide 27

Slide 27 text

HTTPηογϣϯ؅ཧ

Slide 28

Slide 28 text

Ͳ͜ʹηογϣϯσʔλΛอ࣋͢Δ͔ client client session client session session app session app app app app app Stateful Stateless εέʔϧΞ΢τ࣌ʹηογϣϯετΞͷՄ༻ੑΛߟྀ͢Δඞཁ͋Γ ཁSticky Session ʢηογϣϯಉظΛͯ͠΋Πϯελϯε਺͕૿͑ͨ৔߹ͳͲݶք͕͋Δʣ ηογϣϯແޮԽͷ੍ޚͳͲɺηΩϡϦςΟ໘ͷ஫ҙ͸ඞཁ Cookie Store (JWT͸ηογϣϯσʔλอ࣋ʹ͸๬·͘͠ͳ͍) KVSͳͲ ՄೳͳݶΓΞϓϦ֎෦ʹอ࣋͠ɺΞϓϦΛεςʔτϨεʹ͓ͯ͘͠ͷ͕๬·͍͠ 28

Slide 29

Slide 29 text

29 • KubernetesͷSticky SessionػೳΛར༻ • Service (L4 Load Balancing) • service.spec.sessionAffinityΛClientIPʹ͢Δ • Ingress (L7 Load Balancing) • NGINX Ingress Controllerͷ৔߹ • metadata.annotationsΛࢦఆ StatefulͳطଘΞϓϦΛվमͤͣʹks8্Ͱಈ͔͍ͨ͠ annotations: nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/session-cookie-name: "route" nginx.ingress.kubernetes.io/session-cookie-hash: "sha1"

Slide 30

Slide 30 text

αʔϏεϝογϡ

Slide 31

Slide 31 text

31 ϚΠΫϩαʔϏεͷෳࡶ͞ https://www.slideshare.net/BruceWong3/the-case-for-chaos Twitter’s Death Star Netflix’s Death Star https://twitter.com/adrianco/status/441883572618948608

Slide 32

Slide 32 text

32 • ෳ਺ͷ෼ࢄαʔϏεؒͷ௨৴ • ϧʔςΟϯά • ϩʔυόϥϯγϯά • αʔϏεݸผͷϦϦʔε • Blue/GreenσϓϩΠϝϯτ • ΧφϦΞϦϦʔε ߟ͑Δ͜ͱ͸ଟ͍ • ো֐Өڹͷ࠷খԽ • αʔΩοτϒϨʔΧ • ϩά΍ϝτϦΫεͷऩूɾ؂ࢹ • ෼ࢄτϨʔγϯά

Slide 33

Slide 33 text

33 • Netflix OSS • Eureka + RibbonɿαʔϏεσΟεΧόϦ • HystrixɿαʔΩοτϒϨʔΧ • Spring CloudγϦʔζ ౳ʑɾɾɾ ϥΠϒϥϦ΍ϑϨʔϜϫʔΫͰͷରԠ͸ॏ͍ ࣮૷ݴޠʹґଘ ղܾ͍ͨ͜͠ͱʹ߹ΘͤͯݸผʹϥΠϒϥϦબఆʢֶशίετͷ૿େʣ ΞϓϦέʔγϣϯͷຊ࣭Ͱ͸ͳ͍෦෼ʹ։ൃऀͷوॏͳϦιʔε͕औΒΕΔ

Slide 34

Slide 34 text

34 • ౰ॳɿ෼ࢄγεςϜʹ͓͚ΔαʔϏεؒ௨৴ • ໢ͷ໨ (mesh) ͷΑ͏ʹෳࡶʹབྷΈ߹͏௨৴ܦ࿏ • ۙ೥ɿαʔϏεؒ௨৴Λ੍ޚɾ؅ཧ͢Δ࢓૊Έ • τϥϑΟοΫ؅ཧ • ରো֐ੑ • ςετ • ؂ࢹɺ౳ʑ αʔϏεϝογϡ https://www.slideshare.net/BruceWong3/the-case-for-chaos

Slide 35

Slide 35 text

35 • αʔϏεؒ௨৴Λ౷߹؅ཧ͢ΔιϦϡʔγϣϯ • Google/IBM/Lyftࣾ։ൃͷOSS • 2018/7 v1.0ϦϦʔε Istio ϚϧνϓϥοτϑΥʔϜରԠʢݱࡏKubernetesɺConsulʹରԠʣ ΞϓϦέʔγϣϯίʔυ΁ͷ૊ΈࠐΈෆཁ ΞϓϦέʔγϣϯ࣮૷ʹґଘ͠ͳ͍ ؂ࢹɺ෼ࢄτϨʔγϯάͳͲपลπʔϧͱͷ਌࿨ੑ͕ߴ͍

Slide 36

Slide 36 text

36 • αʔϏεؒͷϓϩΩγͱͯ͠ಈ࡞ Istioಈ࡞Πϝʔδ Container App Service Container App Service Kubernetes Container App Service Istio

Slide 37

Slide 37 text

37 Istioػೳ • ϧʔςΟϯά • ϩʔυόϥϯγϯά • ϦτϥΠ/λΠϜΞ΢τ/αʔΩοτϒϨʔΧ τϥϑΟοΫ؅ཧ • ೝূɾೝՄ • αʔϏεؒ௨৴҉߸Խ ηΩϡϦςΟ • Logging • ෼ࢄτϨʔγϯά • ֤छϝτϦΫεऩू ςϨϝτϦ

Slide 38

Slide 38 text

38 IstioΞʔΩςΫνϟ • Proxyʹ͸֦ுͨ͠ Λ࢖༻ • C++࣮૷ͷߴ଎ͳL4/7ϓϩΩγ • Graduated CNCF Project • PodͷSidecarͱͯ͠഑ஔ͞ΕΔͨΊΞϓϦ ίʔυͷมߋෆཁ • PodϨϕϧͰDI͞ΕΔΠϝʔδ ProxyͷαʔϏε σΟεΧόϦ ςϨϝτϦ ೝূΩʔ౳ͷ ؅ཧ ֤PodͷSidecar ͱͯ͠഑ஔ Data Plane Control Plane Pod Pod https://istio.io/docs/concepts/what-is-istio/#architecture

Slide 39

Slide 39 text

39 Istio Demo client ؂ࢹ Node Kubernetes Mixer ෼ࢄτϨʔγϯά μογϡϘʔυ Pod Pod Pod frontend postgresql rest-api Proxy Proxy Proxy ςϨϝτϦ Demo؀ڥߏஙऀɿ αΠΦεςΫϊϩδʔ ख௩ ୓

Slide 40

Slide 40 text

40 • αʔϏεϝογϡʹΑͬͯ෼ࢄαʔϏεؒ௨৴Λ౷߹త ʹ੍ޚͰ͖ΔΑ͏ʹͳΔ • αʔΩοτϒϨʔΧͳͲΞϓϦଆͰࣗલ࣮૷͕ෆཁʹ • Istio͸ػೳ͕๛෋ • ωοτϫʔΫपΓͳͲk8sͷػೳͱ߹ΘͤͯͲ͏ߏ੒͢Δ͔ͳͲ શମΛ၆ᛌͨ͠ઃܭεΩϧ͕ٻΊΒΕΔ • ϚΠΫϩαʔϏεΛద༻͢΂͖͔͸Α͘ݕ౼͢Δ αʔϏεϝογϡ·ͱΊ

Slide 41

Slide 41 text

ίϯςφϕʔε։ൃޮ཰޲্πʔϧ

Slide 42

Slide 42 text

42 kubectl logs • ίϯςφ୯Ґͷϩά֬ೝɻpod࠶࡞੒ͷ౓ʹίϚϯυଧͪ௚͢ඞཁ͕͋Δ stern • ϩάΛ֬ೝ͢ΔpodΛॊೈʹࢦఆՄೳ • ਖ਼نදݱ΍labelࢦఆɺnamespaceԣஅͰෳ਺PodͷϩάΛtail • pod࠶࡞੒Ͱid͕มΘͬͯ΋௥ਵͯ͘͠ΕΔ ޮ཰తͳϩά֬ೝ $ $ $ - - - https://github.com/wercker/stern Deployment ReplicaSet Pod 1 Pod 2 Container A Container B Container A Container B kubectl logs stern

Slide 43

Slide 43 text

43 • for Docker • Docker for Mac • https://docs.docker.com/docker-for-mac/#install-shell-completion • Windows PowerShell༻΋͋Γʢະݕূʣ (※) bash on WindowsͰDockerΛ࢖͏ख΋͋Γʢ޻෉͕ඞཁʣ • https://github.com/matt9ucci/DockerCompletion • for Kubernetes • kube-prompt • https://github.com/c-bata/kube-prompt ίϚϯυิ׬

Slide 44

Slide 44 text

44 Docker command-line completion

Slide 45

Slide 45 text

45 kube-prompt

Slide 46

Slide 46 text

46 • freshpod • ϩʔΧϧΠϝʔδͷߋ৽Λݕ஌ͯ͠PodΛ࠶σϓϩΠͯ͘͠ΕΔ • freshpodࣗମ΋podͱͯ͠ಈ࡞ • MinikubeɺKubernetes on Docker for Windows/MacͰར༻Մೳ k8s։ൃϫʔΫϩʔυͷޮ཰ԽʢΠϝʔδߋ৽ݕ஌ʣ freshpodʹΑΓࣗಈԽ͞ΕΔ෦෼ ߋ৽ ࣗಈݕ஌ https://github.com/GoogleCloudPlatform/freshpod imagePullPolicy͸IfNotPresentͱ͢Δඞཁ͋Γ Coding Build Deploy Test

Slide 47

Slide 47 text

freshpodʹΑΓࣗಈԽ͞ΕΔ෦෼ ߋ৽ ࣗಈݕ஌ Coding Build Deploy Test 47 • entr (Event Notify Test Runner) • ίʔυमਖ਼Λݕ஌ͯ͠೚ҙͷίϚϯυ࣮ߦ͕ՄೳͳCLI • freshpodͱ૊Έ߹ΘͤΔ͜ͱͰίʔυमਖ਼ΛࣗಈతʹPod΁൓өՄೳ k8s։ൃϫʔΫϩʔυͷޮ཰Խʢίʔυमਖ਼ݕ஌ʣ entrʹΑΓࣗಈԽ͞ΕΔ෦෼ http://eradman.com/entrproject/ *.' .$- . ' * ' - $ ίʔυอଘͷ౓ʹPod࠶ىಈ͕ൃੜ͢ΔͨΊ࡞ۀ಺༰ʹΑͬͯదٓ࢖༻͢Δ ߋ৽ ࣗಈݕ஌

Slide 48

Slide 48 text

Skaffold Pipeline 48 • Skaffold • σϓϩΠ·ͰͷύΠϓϥΠϯΛࣗಈԽ͢ΔGoogle੡CLIπʔϧ • ֤ϑΣʔζͷॲཧΛϓϥάΠϯతʹࠩସՄೳ • ϩʔΧϧ։ൃத͸Πϝʔδpushෆཁͱͨ͠ΓɺσϓϩΠʹHelmΛར༻ͨ͠Γɺ౳ʑ • Πϝʔδͷλά΋ࣗಈ෇༩ k8s։ൃϫʔΫϩʔυͷޮ཰ԽʢΑΓॊೈʹʣ Coding Build Deploy Test https://github.com/GoogleContainerTools/skaffold Push docker build docker push kubectl apply GA͍ͯ͠ͳ͍ͨΊɺޓ׵ੑͷͳ͍มߋʹ͸஫ҙ͕ඞཁ https://github.com/GoogleContainerTools/skaffold/blob/v0.19.0/deprecation-policy.md ߋ৽ ࣗಈݕ஌

Slide 49

Slide 49 text

49 • ίϯςφΛ׆༻͢Δ͜ͱͰ؀ڥࠩҟʹۤ͠Ή͜ͱͳ͘ɺΞϓϦΛσϦόϦʔ Ͱ͖Δ • k8sͱΤίγεςϜ܈͸ߴػೳͰ೉͍͕͠ɺඞཁͳϙΠϯτΛߜΔ͜ͱͰֶ शίετ͸Լ͛ΒΕΔ • k8s͸ΤίγεςϜΛ׆༻͢Δ͜ͱͰ࣮૷ෛ୲Λ཈͑ͳ͕Β΋ෳࡶͰॊೈͳ ੍ޚΛ࣮ݱͰ͖Δ • ϏδωεϩδοΫʹूதͰ͖Δ ʢϏδωεͷࠩผԽʹϦιʔεΛूதͰ͖Δʣ ·ͱΊ

Slide 50

Slide 50 text

50 • ԿͷͨΊͷίϯςφɺϚΠΫϩαʔϏε͔ΛݟࣦΘͳ͍ • ΍ͬͺΓۜͷ஄ؙ͸ͳ͍ • ۜͷ஄ؙ͕ͳ͍͔Βͦ͜໘ന͍ • ٕज़Ͱ৽ͨͳՁ஋ΛɺΑΓྑ͍ະདྷ΁ ࠷ޙʹɾɾɾ Enjoy programming!

Slide 51

Slide 51 text

51 • Twelve Factor App by Heroku • https://12factor.net/ja/ • Beyond the Twelve-Factor App by Pivotal • https://content.pivotal.io/blog/beyond-the-twelve-factor-app ʢࢀߟʣΞϓϦઃܭͷώϯτʹɾɾɾ

Slide 52

Slide 52 text

52 • “ΠϯϑϥΤϯδχΞ͕k8sͰΞϓϦΛ࡞ͬͯݟ͑ͨࠓޙͷΠϯϑϥ”, SlideShare • https://www.slideshare.net/susumu0108/k8s-91891197 • “Istioͷશ๴”, Think IT. • https://thinkit.co.jp/article/14640 • “IstioαʔϏεϝογϡೖ໳”, SlideShare • https://www.slideshare.net/yokawasa/istio-114360124 References

Slide 53

Slide 53 text

53 https://tech-lab.sios.jp/ and more!

Slide 54

Slide 54 text

54 ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ