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

はてなリモートインターン2021 マイクロサービス 講義資料

Hatena
October 08, 2021

はてなリモートインターン2021 マイクロサービス 講義資料

Hatena

October 08, 2021
Tweet

More Decks by Hatena

Other Decks in Technology

Transcript

  1. 泘㗧 • microservice • Ͳ͜Ͱ microservice Λ㒻㕴͢Δ͔? • microservice chassis

    • Մ᧺ଌੑ (observability) • service 㕽㙳৴ • 㒻ࢄ data ؅ཧ • micro frontend • microservice ͷ release
  2. NJDSPTFSWJDF micro + service micro- : খ͞ͳ service : a

    system that provides something that the public needs, organized by the government or a private company (Oxford)
  3. NJDSPTFSWJDF micro + service micro- : খ͞ͳ service : a

    system that provides something that the public needs, organized by the government or a private company (Oxford)
  4. NJDSPTFSWJDF micro + service micro- : খ͞ͳ service : a

    system that provides something that the public needs, organized by the government or a private company (Oxford) [user needs] <-(provides something)- [system (= service)]
  5. NJDSPTFSWJDF micro + service micro- : খ͞ͳ service : a

    system that provides something that the public needs, organized by the government or a private company (Oxford) [user ͷٻΊ] <-(෺ࣄΛఏڙ͢Δ)- [࢓૊Έ (= service)]
  6. TFSWJDF service ͷதͰ͸ᒬʑͳ process (OS process, goroutine, OOP class instance,

    etc.) ͕ಈ͍ͯΙΔ [ଞͷ process ͔Βͷೖྗ] <-(ܭࢉ΍ख᠃͖)- [process = (service)]
  7. TFSWJDF service ͷதͰ͸ᒬʑͳ process (OS process, goroutine, OOP class instance,

    etc.) ͕ಈ͍ͯΙΔ [ଞͷ process ͔Βͷೖྗ] <-(ܭࢉ΍ख᠃͖)- [process = (service)]
  8. TFSWJDF [user ͷٻΊ] <-(෺ࣄΛఏڙ͢Δ)- [࢓૊Έ (= service)] user ͱ࢓૊Έ͸نଇ (protocol)

    ʹኺͬͯ΍ΓऔΓ͢Δ ྫ : • menu ʹԊͬͯḼ亣͠୅ۚΛ፫; <- 㘆඼Λ㗵͚౉͢ • HTTP request <- HTTP response
  9. TFSWJDF microservice ͷ㑔ޠ : SOA (service oriented architecture) Amazon @

    2002 1)͜ͷ࣌఺ΑΓɺશͯͷνʔϜ͸αʔϏεΠϯλʔϑΣʔεΛ௨ͯ͡શͯͷσʔλͱػೳΛެ։͢Δ͜ͱɻ 2)֤νʔϜ͸֤ʑͦͷΠϯλʔϑΣʔεΛ௨ͯ͡௨৴͠ͳ͚Ε͹ͳΒͳ͍ɻ 3)ͦͷଞͷશͯͷϓϩηεؒ௨৴͸ڐՄ͞Εͳ͍ɻμΠϨΫτϦϯΫɺଞͷνʔϜͷσʔλιʔε͔Β௚઀ σʔλΛಡΉ͜ͱɺϝϞϦڞ༗ϞσϧɺόοΫυΞɺશͯΛې͡ΔɻωοτϫʔΫӽ͠ͷαʔϏεΠϯλʔ ϑΣʔεΛܦ༝ͨ͠௨৴͚͕ͩڐՄ͞ΕΔɻ 4)࢖༻͢Δٕज़͸໰Θͳ͍ɻ HTTP ɺ Corba ɺ Pubsub ɺ ΧελϜϓϩτίϧɺԿͰ΋ྑ͍ɻ Bezos ͸ؾʹ ͠ͳ͍ɻ 5)શͯͷαʔϏεΠϯλʔϑΣʔε͸ɺྫ֎ͳ͘ɺ֎෦ʹެ։ՄೳͳΑ͏ʹθϩ͔Βઃܭ͞Εͳ͚Ε͹ͳΒͳ ͍ɻ͢ͳΘͪɺνʔϜ͸શੈքͷσϕϩούʹ޲͚ͯΠϯλʔϑΣʔεΛެ։͢Δ͜ͱ͕Ͱ͖ΔΑ͏ɺઃܭ ͠ɺܭը͠ͳ͚Ε͹ͳΒͳ͍ɻྫ֎͸ແ͍ɻ Steve Yegge ͷ Google ͱϓϥοτϑΥʔϜʹؔ͢ΔͿͬͪΌ͚࿩Λ༁ͨ͠ʢલฤʣ
  10. TFSWJDF microservice ͷ㑔ޠ : SOA (service oriented architecture) Amazon @

    2002 1)͜ͷ࣌఺ΑΓɺશͯͷνʔϜ͸ αʔϏεΠϯλʔϑΣʔεΛ௨ͯ͡શͯͷσʔλͱػೳΛެ։͢Δ ͜ͱɻ 2)֤νʔϜ͸֤ʑ ͦͷΠϯλʔϑΣʔεΛ௨ͯ͡௨৴͠ͳ͚Ε͹ͳΒͳ͍ ɻ 3)ͦͷଞͷશͯͷϓϩηεؒ௨৴͸ڐՄ͞Εͳ͍ɻμΠϨΫτϦϯΫɺଞͷνʔϜͷσʔλιʔε͔Β௚઀ σʔλΛಡΉ͜ͱɺϝϞϦڞ༗ϞσϧɺόοΫυΞɺશͯΛې͡ΔɻωοτϫʔΫӽ͠ͷαʔϏεΠϯλʔ ϑΣʔεΛܦ༝ͨ͠௨৴͚͕ͩڐՄ͞ΕΔɻ 4)࢖༻͢Δٕज़͸໰Θͳ͍ɻ HTTP ɺ Corba ɺ Pubsub ɺ ΧελϜϓϩτίϧɺԿͰ΋ྑ͍ɻ Bezos ͸ؾʹ ͠ͳ͍ɻ 5)શͯͷαʔϏεΠϯλʔϑΣʔε͸ɺྫ֎ͳ͘ɺ֎෦ʹެ։ՄೳͳΑ͏ʹθϩ͔Βઃܭ͞Εͳ͚Ε͹ͳΒͳ ͍ɻ͢ͳΘͪɺνʔϜ͸શੈքͷσϕϩούʹ޲͚ͯΠϯλʔϑΣʔεΛެ։͢Δ͜ͱ͕Ͱ͖ΔΑ͏ɺઃܭ ͠ɺܭը͠ͳ͚Ε͹ͳΒͳ͍ɻྫ֎͸ແ͍ɻ Steve Yegge ͷ Google ͱϓϥοτϑΥʔϜʹؔ͢ΔͿͬͪΌ͚࿩Λ༁ͨ͠ʢલฤʣ
  11. NPOPMJUI service 㚎ͷ process ΍ OOP class instance ͕ɺଞͷ process

    ΍ OOP class instance Λ user ͱͯ͠෺ࣄΛఏڙ ͯ͠ΙΕ͹ɺ͜ΕΒ΋ service ͱݟ၏ͤΔ [user class] <-(෺ࣄΛఏڙ͢Δ)- [provider class]
  12. NPOPMJUI service 㚎ͷ process ΍ OOP class instance ͕ɺଞͷ process

    ΍ OOP class instance Λ user ͱͯ͠෺ࣄΛఏڙ ͯ͠ΙΕ͹ɺ͜ΕΒ΋ service ͱݟ၏ͤΔ Ͱ͸ process ͸ microservice Ͱͤ͏͔?
  13. NPOPMJUI microservice ʹԙ͚Δݸʑͷ service ͸ deploy ᄸҐ • ᘐཱʹ deploy

    ͢ΔͷͳΒ microservice • వΊͯ deploy ͢ΔͳΒ monolith ઃܭʹ͸ microservice ͱ monolith Ͱಉ͡ख๏͕㒊΁ΔɻಘΒΕΔᏈՌ΋ࣅΔ ྫ : refactoring (㘟㕡㙹 architecture)
  14. CVTJOFTTDBQBCJMJUZס㗞 [user ͷٻΊ] <-(෺ࣄΛఏڙ͢Δ)- [࢓૊Έ (= service)] business capability ͷڥ

    = user ͷٻΊΔ෺ࣄͷڥ • user ͕ҟͳΔ • user ͸ಉ͕ͩ͡ٻΊΔ෺ࣄ͕ҟͳΔ
  15. CVTJOFTTDBQBCJMJUZס㗞 Conway ͷ๏ଇ : service ͷ㗇㙉͸૊৫ͷ㗇㙉ʹኺ; ૊৫͕㗇㙉 X Λ࣋ͭ =>

    service ͷ㗇㙉͕ X ʹ㖢ෟ͘ service ͷ㗇㙉Λ X ʹ͢Δ <= ૊৫ͷ㗇㙉Λ X ʹ͢Δ
  16. CVTJOFTTDBQBCJMJUZס㗞 Conway ͷ๏ଇ : service ͷ㗇㙉͸૊৫ͷ㗇㙉ʹኺ; ཧ༝ : 1. team

    㕽ͷ communication ͸ team 㚎ͷ communication ΑΓࠔ㐾Ͱ͋Δ 2. ։ᚙ (dev) ͱ㕑༻ (ops) ͷᴥᴪ 3. ։ᚙ process ͷதʹᯅΕͨ cost
  17. CVTJOFTTDBQBCJMJUZס㗞 Conway ͷ๏ଇ : service ͷ㗇㙉͸૊৫ͷ㗇㙉ʹኺ; ཧ༝ : 1. team

    ⇭ͷ communication ͸ team ⤨Ƒ communication ΑΓࠔ㐾Ͱ͋Δ 2. ։ᚙ (dev) ͱ㕑༻ (ops) ͷᴥᴪ 3. ։ᚙ process ͷதʹᯅΕͨ cost ʮservice Λ㒻͚ΔͳΒ team Λ㒻͚Δʯ͸ཧ༝ 1 ʹண໨ͯ͠ΙΔ
  18. CVTJOFTTDBQBCJMJUZס㗞 1. team ⇭ͷ communication ͸ team ⤨Ƒ communication ΑΓࠔ㐾Ͱ͋Δ

    service ͷᏓ㒁ʹ͍ͭͯɺ • team Λ㒻͚Δͱ team 㚎 communication ͷ cost ͕ݮΔ (path ͕ݮΔ) • team Λ㒻͚Δͱ team 㕽 communication ͷ cost ͕⃧͑Δ (亣຺ (context) ͕ڞ༗͞ΕͯΙͳ͍)
  19. CVTJOFTTDBQBCJMJUZס㗞 1. team ⇭ͷ communication ͸ team ⤨Ƒ communication ΑΓࠔ㐾Ͱ͋Δ

    service ΛᏓ㒁͢Δࡍͷ team 㕽 communication ʹ͸ɺ • service ͷڞ༗ (Ꮣ㒁͕ࣗݾ׬݁͠ͳ͍) • ਓͷڞ༗ (݉຿)
  20. CVTJOFTTDBQBCJMJUZס㗞 ʮservice Λ㒻͚ΔͳΒ team Λ㒻͚Δʯ͸ɺҎ্ͷ cost ⃧ݮʹ᮫ͯ͠亯㙺ͳͱ͜ΖΛݟෟ͚ͯߦ; Q. 亯㙺? A.

    service શᱪΛΑ͘ɺૉૣ͘Ꮣ㒁͠᠃͚ΔࣄΛ໨ࢦ͢ ཧ༝ 2 ͷղܾࡦ (SRE (site reliability engneering)) ɺཧ༝ 3 ͷղܾࡦ (CD (៺᠃㙹 delivery / deploy)) ΋ಉᒬʹɺ cost ⃧ݮʹ᮫ͯ͠亯㙺ͳͱ͜ΖΛݟෟ͚ͯߦ;
  21. TDBMBCJMJUZס㗞 scaling • scale up : ߴ͍ੑೳͷ server Λ㒊; <->

    scale down • scale out : server ͷᢕᏐΛ⃧΍͢ <-> scale in
  22. TDBMBCJMJUZס㗞 Kubernetes ͷ pod ͩͱɺ • scale up : VPA

    (vertical pod autoscaler) • scale out : HPA (horizontal pod autoscaler)
  23. TDBMBCJMJUZס㗞 The scale cube : service Λ scale out ͢Δࡾख๏

    • x ࣠ : ಉ͡ service Λ ಉ͡໾㕴Ͱ deploy ͢Δ (scale out) • y ࣠ : 㖇ೳ㑌ʹ service Λ㒻㕴͢Δ (microservice) • z ࣠ : ಉ͡ service Λ deploy ͢Δ͕ɺdeploy ͢Δ server 㑌ʹҟͳΔ໾㕴Λ፦͸ͤΔ
  24. TDBMBCJMJUZס㗞 z ࣠ : ಉ͡ service Λ deploy ͢Δ͕ɺdeploy ͢Δ

    server 㑌ʹҟͳΔ໾㕴Λ፦͸ͤΔ ྫ : • batch ႔ཧ༻ server Λผ㙾 deploy ͢Δ • gateway Ͱछ㑔㑌ʹ request Λ㒻͚Δ • DB Λਨ㙮㒻㕴͢Δ (ਫ㚻㒻㕴͸ x ࣠) • DB ͷ read replica Λ㗇㙡͢Δ
  25. TFDVSJUZס㗞 㘒ใ security ͷࡾ㛿ૉ • C : 㖇ີੑ (confidentiality) •

    I : ׬㙂ੑ (integrity) • A : Մ༻ੑ (availability)
  26. TFDVSJUZ㖇㳡䓪 DPOEFOUJBMJUZ ס㗞 access ੍ޚ • AWS IAM • Kubernetes

    ͷ ServiceRoleɺClusterRole • OPA (open policy agent)
  27. TFDVSJUZ⺎榫䓪 BWBJMBCJMJUZ ס㗞 ো᛻Λ೾㖎ͤ͞ͳ͍ • fault tolerance • API rate

    limit • circuit braker ো᛻͔Β伭෮͢Δ • auto healing • back pressure
  28. NJDSPTFSWJDFDIBTTJT ͲΜͳ microservice ʹ΋㛿ΔɺԣᏗ㙹ͳ᮫৺ࣄ (cross cutting concern) Λመ᧋͢Δ ྫ :

    • ઃఆͷ㙦ೖ • Մ᧺ଌੑ (observability) • health check • graceful shutdown • error handling • debug • service discovery • service 㕽㚒ᨽɾ㚒Մ
  29. ⺎鈴峮䓪 PCTFSWBCJMJUZ service ͷᕝ͍ͨͨ͠ੑ࣭ : • Մ᧺ଌੑ (observability) : ᧺ଌ͔Β

    service ͷ㐫ଶΛਪଌͰ͖Δ • Մ੍ޚੑ (controllability) : service Λ㛕Ή㐫ଶʹᏓ㒁Ͱ͖Δ • ҆ఆੑ (stability) : service ͷ㐫ଶ͸Ұఆͷൣᅴʹཹ·Δ
  30. ⺎鈴峮䓪 PCTFSWBCJMJUZ Մ᧺ଌੑͷࡾ㚋㖥 : • metric (ྫ : Prometheusɺ Mackerel

    :-)) • tracing (APM (application performance monitoring)ɺ㒻ࢄ tracing) • logging (㗇㙉㕡 logɺहूɺ㒻ੳ)
  31. TFSWJDF㕽㙳⟓ ઌʹنଇ (protocol) ΛܾΊΔͱɺ㙳৴ઌͷ service Λᔅʹͤͣ։ᚙͰ͖Δ 㙳৴ํࣜنଇͷྫ : • HTTP

    • message broker (Amazon SQSɺAmazon SNSɺGoogle Cloud Pub/SubɺKafkaɺNATSɺAMQP) • GraphQL • gRPC
  32. TFSWJDF㕽㙳⟓ ઌʹنଇ (protocol) ΛܾΊΔͱɺ㙳৴ઌͷ service Λᔅʹͤͣ։ᚙͰ͖Δ => schema first schema

    first ʹ͢Δͱɺ • ։ᚙ㐥㕽ͷ communication cost ͕Լ͕Δ • schema Λ㒊ͬͯ test Ͱ͖Δ schema ͸㛿ٻ service ͱఏڙ service ͷڞ༗ࢿݯ (ཧ༝ 3 : ڞ༗ࢿݯͳͷͰ CD (៺᠃㙹 delivery) ͢Δͷ͕㛕·͍͠)
  33. TFSWJDF㕽㙳⟓ 㙳৴͕نଇ (protocol) ʹኺͬͯΙΕ͹ɺ㙳৴࿏͸ந৅Ͱ͖Δ container (ྫ : containerd) ͱ orchestrator

    (ྫ : Kubernetes) ͸ɺ႔ཧ㕹ڥ (service 㕹ڥ : ops) ͔Β႔ཧ㚎༰ (service 㚎 ༰ : dev) Λந৅ͨ͠ ͔͠͠㙳৴㕹ڥ (service 㕽㕹ڥ) ͔Β㙳৴㚎༰ (service 㕽㚎༰) ͷந৅ (ྫ : Kubernetes' sevice) ͸ෆॆ㒻
  34. TFSWJDF㕽㙳⟓ 㙳৴͕نଇ (protocol) ʹኺͬͯΙΕ͹ɺ㙳৴࿏͸ந৅Ͱ͖Δ container (ྫ : containerd) ͱ orchestrator

    (ྫ : Kubernetes) ͸ɺ႔ཧ㕹ڥ (service 㕹ڥ : ops) ͔Β႔ཧ㚎༰ (service 㚎 ༰ : dev) Λந৅ͨ͠ ͔͠͠㙳৴㕹ڥ (service 㕽㕹ڥ) ͔Β㙳৴㚎༰ (service 㕽㚎༰) ͷந৅ (ྫ : Kubernetes' sevice) ͸ෆॆ㒻 => service mesh
  35. TFSWJDFNFTI service ͸ଞͷ service ͱ㙮઀㙳৴͠ͳ͍ɻ㕽ʹ proxy ͕ೖΓɺproxy ͕㙳৴Λ᧺ଌɾ੍ޚ͢Δ 㖇ೳͷྫ :

    • ၊૝ service • load balancing • timeoutɺretry • health checkɺcircuit braker • fault injection • 㕆ᥒ㕡ɺ㚒ᨽ • deploy ؅ཧ (A/B testingɺcanary releaseɺrollout (linearɺB/G (Blue/Green))) •
  36. TFSWJDFNFTI service ͸ଞͷ service ͱ㙮઀㙳৴͠ͳ͍ɻ㕽ʹ proxy ͕ೖΓɺproxy ͕㙳৴Λ᧺ଌɾ੍ޚ͢Δ Q. proxy

    ࣗᱪ͸ container Ͱಈ͘ඞ㛿͕͋Γ·͔͢? A. ͍͍͑ɻመࡍͷ network 㖇ೳ΍ topology Λந৅͠౷Ұ㙹ʹ᧺ଌɾ੍ޚͰ͖Ε͹ཧ࿦্͸ɺΑΓ native ͳ software ΍ kernel ΍ bare metal Ͱመ᧋͢Δࣄ΋ՄೳͰ͢ɻSDN (software defined networking) ͸ͦͷࢼΈͱ΋ ݴ΁·͢
  37. *TUJP control plane ͷಇ͖ • data plane Λ㗇㙡͢Δ : sidecar

    injection • data plane Λઃఆ͢Δ : Envoy ͷઃఆΛ࡞Γɺઃఆ͢Δ • data plane ͔Βͷ໰ͻ߹͸ͤʹ౴΁Δ : ઃఆʹදͤͳ͍ Envoy ͷ੍ޚ • data plane Λ᧺ଌ͢Δ : Մ᧺ଌੑ (observability)
  38. *TUJP • data plane Λઃఆ͢Δ : Envoy ͷઃఆΛ࡞Γɺઃఆ͢Δ • data

    plane ͔Βͷ໰ͻ߹͸ͤʹ౴΁Δ : ઃఆʹදͤͳ͍ Envoy ͷ੍ޚ
  39. 㒻丆EBUB畘杼 software = data + ႔ཧ data ͷ㕅ͻ͸ read ͱ

    write ʹ㒻͚ΒΕΔ (cf. CQRS (command query ੹຿㒻཭)) • read : [microservice] <-(data ΛᩇΈग़͢)- [microservice] • write : [microservice] <-(data Λอଘͤ͞Δ)- [microservice]
  40. 㒻丆EBUB畘杼SFBE API composition ࣅͨख๏ : • API gateway : API

    composition Λߦ;ሢ༻ͷ microservice • BFF (backend for frontend) : ಛఆͷ frontend ޲͚ͷ API gateway
  41. 㒻丆EBUB畘杼XSJUF TCC (try-confirm / cancel) ΍ͬͯΈͯɺΈΜͳΑ͚Ε͹อଘɺ୭͔ବ໨ͳΒ cancel a.k.a. ೋ૬ commit

    Ұൠ㙹ʹ͸ DBMS (database management system) ʹෟሱ͢Δ transaction 㖇ೳΛ㒊;͕ɺͦΕʹݶΒͳ͍ Մ༻ੑʹ㐾͋Γ
  42. 㒻丆EBUB畘杼XSJUF saga ׬݁ͨ͠ transaction Λ૊Έ߹͸ͤͯෳᏐͷ DB ΛᏓ㒁͢Δ transaction ͕ࣦഊͨ͠Βɺ㖅ʹመߦͨ͠ transaction

    Λଧͪ㘌͢ิঈ transaction Λመߦͯ͠ rollback ͢Δɻิ ঈ transaction ͸֬መʹመߦͰ͖Δᗣɺႈ౳ʹ͠ retry ՄೳͰͳ͚Ε͹ͳΒͳ͍
  43. 㒻丆EBUB畘杼 CAP ఆཧ : ҎԼͷࡾᑍ݅Λಉ࣌ʹ׬શʹ㙘㘫Ͱ͖ͳ͍ • Ұ؏ੑ (consistency) • Մ༻ੑ

    (availability) • network 㒻Ꮧ଱ੑ (partition tolerance) BASE : ෦෼తʹͰ͋Ε͹ CAP ͸ಉ࣌ʹ㙘㘫Ͱ͖Δ (<-> ACID (ݪࢠੑ (atomicity)ɺҰ؏ੑ (consistemcy)ɺᘐཱੑ (isolation)ɺӬ᠃ ੑ (durability))) • Basically Available • Soft-state • ݁Ռ੔߹ੑ (Eventually consistent)
  44. NJDSPGSPOUFOE microservice Λ։ᚙ͢Δ team ͕ɺ֘ᙛ͢Δ frontend ΋։ᚙ͢Δ ͍҃͸ business capability

    ʹԊͬͯ frontend ͚ͩ㒻㕴ͯ͠͠·; < microservice Ͱߦͬͨͷͱಉٞ͡࿦
  45. NJDSPGSPOUFOE 㒻㕴ख๏ : • page 㙂ᱪΛఏڙ͢Δ (route-based code splitting) •

    component Λఏڙ͢Δ (ྫ : React componentɺCSS in JSɺCSS Module) • error ͸ด͡㗓ΊΔ
  46. NJDSPGSPOUFOE㕽㙳⟓ • frontend ಉ࢜͸㙳৴ͤͣɺbackend Λհ͢Δ • URL ͷ query string

    Λհ͢Δɻpage ͕㒻͔ΕͯΙΔͳΒ༗༻ • property Λհͯ͠౉͢ (ྫ : React propertyɺDOM attribute) • event emitter • 㐫ଶΛڞ༗͢Δ (ڞ༗ DB ͱಉ͡ࠔ㐾Λ᧷ޛ͢Δ) (ྫ : Redux Λڞ༗)
  47. NJDSPGSPOUFOE 㒻㕴ͨ͠΋ͷΛ഑৴͢Δख๏ : • 㙂͘ҟͳΔ Web site ͱͯ͠㗇㙡͢Δ • bundling

    (ྫ : Webpack) • backend Ͱ૊Έ߹͸ͤΔ (ྫ : SSI (server-side includes)ɺESI (edge-side includes)) • lazy load (ྫ : loadable-componentsɺdynamic import)
  48. NJDSPTFSWJDFסSFMFBTF release Λࡾͭʹ㒻͚Δ : build + deploy + release •

    canary release • B/G (Blue/Green) deloyment • feature toggle
  49. NJDSPTFSWJDFסSFMFBTF 㒻ࢄ system Ͱ͸೗ԿͳΔ release खॱͰ΋ɺ2 version ͕ᝀཱ͠͏Δ ሣࡦ :

    • ޙํޓ׵ੑΛอͭ • API versioning ʹͯ৽ API Λᢜ client ͔Β੾Γ཭͢ • error budget ΛఆΊɺerror Λڐ༰͢Δ • fronend ౳ cache ͷڧ੍ purge Λመ᧋͢Δ
  50. ׷זיײ׷ֹ*TUJP㚊⪌ • istioctl Λ install ͠·ͤ͏ • istioctl install !"set

    profile=demo !"context hatena-intern-2021 • kubectl label namespace hatena-intern-2021 istio-injection=enabled • kubectl get namespace hatena-intern-2021 -o yaml Ͱ istio-injection ͕ enabled ʹ ͳͬͯΙΔ͜ͱΛ֬㚒͠·͢
  51. ׷זיײ׷ֹ*TUJP㚊⪌ • kubectl apply -f https:!"raw.githubusercontent.com/istio/istio/release-1.7/ samples/addons/kiali.yaml Ͱ Kiali Λ㚊ೖ͠·͢

    • kubectl apply -f https:!"raw.githubusercontent.com/istio/istio/release-1.7/ samples/addons/prometheus.yaml Ͱ Prometheus Λ㚊ೖ͠·͢ • application Λ九㖈ಈ͠·ͤ͏ • istioctl dashboard kiali Ͱ㐫ଶΛ֬㚒͠·ͤ͏ • sign in ͸ admin:admin
  52. ׷זיײ׷ֹGBVMUJOKFDUJPO ಛఆͷ㖇ೳʹ㕇ᅷ㙹ʹނোΛᚙੜͤͯ͞Ө伖ൣᅴΛ㙭΂·͢ • Injecting an HTTP abort fault Λࢀ㒅ʹɺrenderer service

    Λམͱͯ͠Έ·ͤ͏ (503 Service Temporarily Unavailable)ɻهࣄΛӾཡɾ࡞㘫ɾ㒁৽Ͱ͖Δ͔֬㚒͠·ͤ͏ɻfault %age ΛԼ͛ͨͱ͖ͷᎮಈΛ֬㚒͠· ͤ͏ • Kiali Ͱ application ͷ㐫ଶΛ֬㚒͠·ͤ͏ • blog service ͷ error message Λ֬㚒͠·ͤ͏ɻ·ͨ istio-proxy ͷ log ͔Β "authority": "renderer-go:50051" Λ୳͠ɺresponse_flags ͷ㙟Λ֬㚒͠·ͤ͏
  53. ׷זיײ׷ֹGBVMUJOKFDUJPO • renderer service Λɺਖ਼ৗʹಈ࡞͢Δ͕ɺresponse ͕ 5 ඵᬌΕΔ㐫ଶʹ͍ͯͩ͘͠͞ • Kiali

    Ͱ application ͷ㐫ଶΛ֬㚒͠·ͤ͏ • istio-proxy ͷ log ͷ response_flags Λ֬㚒͠·ͤ͏ • kubectl delete virtualservices.networking.istio.io [໊㙁] Ͱ fault injection Λղআ͠· ͤ͏
  54. 㒁מ㱃שמע CloudNative • CNCF Cloud Native Interactive Landscape • The

    Amazon Builders' Library microservice • microservice - .ŇoO(ͬͪ͞ΌΜͰ͢Αʌ(ʏl _ l)ůƄ ˑ) • Sam NewmanʮϚΠΫϩαʔϏεΞʔΩςΫνϟʯ2016 • Susan J. FowlerʮϓϩμΫγϣϯϨσΟϚΠΫϩαʔϏεԽʯ2017 • Neal Ford, Rebecca Parsons, Patrick KuaʮਐԽతΞʔΩςΫνϟʯ2018 • Sam NewmanʮϞϊϦε͔ΒϚΠΫϩαʔϏε΁ʯ2020