Upgrade to Pro — share decks privately, control downloads, hide ads and more …

カラーミーショップのクラウドネイティブに向けた取り組み

takapi86
December 24, 2020

 カラーミーショップのクラウドネイティブに向けた取り組み

Pepabo Tech Conference #13
https://pepabo.connpass.com/event/197089/

takapi86

December 24, 2020
Tweet

More Decks by takapi86

Other Decks in Technology

Transcript

  1. 2 2 ࣗݾ঺հ • ໊લ: ∁ڮ༤ل • Twitter: @takapi86 •

    ॴଐ: GMOϖύϘ ECࣄۀ෦ Χϥʔϛʔγϣοϓάϧʔϓ αʔϏεج൫νʔϜ • WebΞϓϦέʔγϣϯΤϯδχΞ • ۀ຿Ͱ΍͍ͬͯΔ͜ͱ ◦ ϨΨγʔ؀ڥͷվળ ◦ ηΩϡϦςΟڧԽ
  2. 6 6 boost2020 ϓϩδΣΫτ͕ൃ଍ʂʂ • ৽ܕίϩφՒʹ͓͍ͯɺωοτγϣοϐϯάͷར༻ऀ͕ٸ૿ ◦ ECͷαʔϏεʹର͢Δظ଴ײ͸ߴ·͍ͬͯΔ⬆⬆ • ೔ຊதͷ঎͍Λ͢Δࣄۀऀ͕ͳΊΒ͔ʹΧϥʔϛʔγϣοϓ

    Λ׆༻ͨ͠ΦϯϥΠϯࣄۀܗଶ(EC)ʹDX͢Δ͜ͱΛՃ଎ͤ͞ ΔͨΊͷऔΓ૊Έ ◦ ϓϩϞʔγϣϯϨϕϧͷ޲্ ◦ γεςϜϨϕϧͷ޲্ ࣛࣇౡݶఆͰTVCM΋์ө͞Ε·ͨ͠ʂ
  3. 9 ୈ1ஈରԠʢݱࡏͷߏ੒ʣ NyahʢϓϥΠϕʔτOpenStack؀ڥʣ্ͷΠϯελϯεʹɺ ֤ϩʔϧͷΞϓϦέʔγϣϯ͕σϓϩΠ͞Ε͍ͯΔ ฼؋A ฼؋B γϣοϓϖʔδ Χʔτϖʔδ API ϩʔυόϥϯα

    ϩʔυόϥϯα ฼؋A ฼؋B γϣοϓϖʔδ Χʔτϖʔδ API ϩʔυόϥϯα ϩʔυόϥϯα ຊ൪؀ڥ ຊ൪෼཭؀ڥ ʢख࡞ۀͰߏஙʣ 9
  4. 10 ShopSet Χʔτϖʔδ γϣοϓϖʔδ API Ϧόʔε ϓϩΩγ LB https://hoge.shop-pro.jp 10

    ShopSetΞʔΩςΫνϟ k8s Cluster k8s Cluster ShopSet ShopSet ShopSet ShopSet
  5. 16 ͳʹҠઃͨ͠ͷ͔ ͦͷଞͷཧ༝ • ٕज़తʹνϟϨϯδ͠΍͍͢؀ڥͩͬͨ ◦ ػೳ਺͕ϝʔϧςϯϓϨʔτͷ࡞੒ɺΞυϨεாͷ࡞੒ɺ഑৴༧ ໿ͱগͳ͍ ◦ ΞΫηεՄೳͳϢʔβ΋ଞͷϩʔϧʹൺ΂ݶΒΕ͍ͯΔ

    • PuppetϚχϑΣετ͕ϝϯςφϯε͞Εͳ͘ͳͬͯ͠·͍ɺखಈͰ ϥΠϒϥϦͷΞοϓσʔτͳͲΛߦ͍ͬͯͨ ◦ ʢଞͷϩʔϧ͸ͪΌΜͱϝϯςφϯε͞Εͯ·͢ʣ • ։ൃ؀ڥ͸͢ͰʹDockerͰಈ͘Α͏ʹͳ͍ͬͯͨ 16
  6. 18 ߏ੒ • OS: CentOS6 ◦ => CentOS7 • ݴޠ:

    PHP ◦ => มߋͳ͠ • Webαʔό: ApacheʢPHPϞδϡʔϧʣ ◦ => Nginx + PHP-FPM • Nyahʢࣾ಺ͷϓϥΠϕʔτΫϥ΢υʣͷΠϯελϯε ◦ =>ɹShopSetΫϥελ(Kubernetes) 18
  7. 19 ͍Ζ͍Ζ՝୊͕ग़͖ͯͨ • ϩάͲ͏͢Δʁ • ΤϥʔͷτϥοΩϯά͸ʁ • ίϯςφͷ؂ࢹ͸ʁ • ηΩϡϦςΟେৎ෉ʁʁ

    • ύϑΥʔϚϯεେৎ෉ʁʁ • ͳ͔ͥPod੾Γସ͑࣌ʹμ΢ϯλΠϜ͕ൃੜ͢Δʂ • σϓϩΠ͸ʁ ɾɾɾͳͲͳͲ 19
  8. 21 ൃੜͨ͠՝୊Λڠྗͯ͠ย෇͚͍ͯͬͨ 21 • ϩά ◦ => Fluentdܦ༝ͰBigQueryʹอଘʢStdOutͷ಺༰͸Cloud Logging΁ʣ •

    ΤϥʔτϥοΩϯά ◦ => Sentryͷಋೖ • ίϯςφ؂ࢹ ◦ => Mackerel Agentͷಋೖ • ίϯςφηΩϡϦςΟ ◦ => ΞϓϦέʔγϣϯίϯςφηΩϡϦςΟΨΠυʢNIST࡞੒ɺ຋༁؂मIPAʣΛνΣοΫ • Pod੾Γସ͑࣌ͷμ΢ϯλΠϜ ◦ => ReadinessProbeɺpreStopͷௐ੔ • ύϑΥʔϚϯε ◦ => ଟΊʹϦιʔεΛऔͬͯϦϦʔεޙௐ੔
  9. 22 σϓϩΠʢShopSet͸ผͷํࣜʣ 22 ։ൃऀ ϝϧϚΨ AppϦϙδτϦ K8sϚχϑΣετ ϦϙδτϦ ࣾ಺ Docker

    Resisty K8s Argo CDʹͯϚχϑΣετΛద༻ CI/CDʹͯɺϚʔδɾΠϝʔδͷϓογϡ ΞϓϦέʔγϣϯ Nginx, PHP-FPM K8sΫϥελ Merge Push Pull ߋ৽ͨ͠ΠϝʔδΛ࢖͏Α͏ʹɺ ϚχϑΣετ಺ͷΠϝʔδλάΛߋ৽