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

Istio integrated Telepresence

Kurumi Morimoto
September 08, 2020

Istio integrated Telepresence

Kurumi Morimoto

September 08, 2020
Tweet

More Decks by Kurumi Morimoto

Other Decks in Technology

Transcript

  1. Shimpei Otsubo @potsbo DX Squad, Wantedly, Inc. 2018 New Grads

    Kubernetes Dev Tools CI / CD AuthN / Z Productivity Dvorak
  2. ©2020 Wantedly, Inc. νʔϜͰͷϚΠΫϩαʔϏε։ൃʹͳΔͱ࿩͕มΘΔ Service B Service C Service A

    σϓϩΠ͕஗͍… Go ͷαʔϏεͳͷʹ Ruby ΍ Python ΋஌Δඞཁ͕… ڞ༗ࢿݯ͸޷͖উखͰ͖ͳ͍… ࠓΫϥελ࢖ͬͯฏؾ͔ͳ…
  3. ©2020 Wantedly, Inc. 1. Fast (ϑΟʔυόοΫ͕଎͍) • มߋ͕ਖ਼͔͔ͬͨ͠Ͳ͏͔ͷϑΟʔυόοΫ͕͙͢ʹಘΒΕΔ 2. Dependency-Agnostic

    (ࣗ෼ͷมߋʹूதͰ͖Δ) • ґଘؔ܎Λҙࣝͤͣ, ࣗ෼͕มߋͨ͠αʔϏεͷΈΛ࣮ߦ͢Ε͹͍͍ 3. Isolated (ଞͷ։ൃऀΛؾʹͤͣ, ޷͖উखʹ։ൃ͍͍ͯ͠) • ଞͷ։ൃऀΛؾʹͤͣ޷͖ͳ࣌ʹ޷͖ͳΑ͏ʹ։ൃ͍͍ͯ͠ ࢲ͕ͨͪߟ͑Δཧ૝ͷ։ൃମݧ 1 ϑΝΠϧͰ׬݁͢Δͱ͖͸Կނྑ͔ͬͨͷ͔ʁ
  4. ©2020 Wantedly, Inc. 1. ϩʔΧϧͰϓϩηεΛ্ཱͪ͛Δ • มߋͨ͠αʔϏεͱґଘ͢ΔϚΠΫϩαʔϏε΍DBΛશͯϩʔΧϧͰ্ཱͪ͛Δ 2. ΫϥελʹσϓϩΠ͢Δ •

    ڞ༗ΫϥελͷϚΠΫϩαʔϏεΛॻ͖׵࣮͑ͯߦ͢Δ 3. TelepresenceͰϩʔΧϧʹϦΫΤετΛྲྀ͢ • ڞ༗ΫϥελͷϧʔςΟϯάΛάϩʔόϧʹมߋ͠, ϩʔΧϧʹϦΫΤετΛྲྀ͢ طଘͷ։ൃख๏͸ཧ૝ͷମݧͰ͸ͳ͍ͷ͔ ϚΠΫϩαʔϏε։ൃͷྺ࢙ΛৼΓฦΔ
  5. ©2020 Wantedly, Inc. 1. ϩʔΧϧͰϓϩηεΛ্ཱͪ͛Δ ϚΠΫϩαʔϏε։ൃͷ࠷ॳͷεςοϓ Service B’ Service C

    Service A @potsbo’s Laptop มߋ͕ਖ਼͔͔ͬͨ͠ͷ ϑΟʔυόοΫ͕ૣ͍ όάͬͯ΋ଞͷ։ൃऀ ͷ໎࿭ʹͳΒͳ͍
  6. ©2020 Wantedly, Inc. 1. ϩʔΧϧͰϓϩηεΛ্ཱͪ͛Δ ϚΠΫϩαʔϏε։ൃͷ࠷ॳͷεςοϓ Service B’ Service C

    Service A @potsbo’s Laptop Go ͷαʔϏεͳͷʹ Ruby ΍ Python ΋஌Δඞཁ͕… ґଘπϦʔΛཧղ͢Δ ඞཁ͕͋Δ
  7. ©2020 Wantedly, Inc. 1. ϩʔΧϧͰϓϩηεΛ্ཱͪ͛Δ ϚΠΫϩαʔϏε։ൃͷ࠷ॳͷεςοϓ Service B’ Service C

    Service A @potsbo’s Laptop 1. ϩʔΧϧͰϓϩηεΛ্ཱͪ͛Δ Fast (ϑΟʔυόοΫ͕଎͍) • มߋ͕ਖ਼͔͔ͬͨ͠Ͳ͏͔ͷϑΟʔυόοΫ͕͙͢ʹಘΒΕΔ Dependency-Agnostic (ࣗ෼ͷมߋҎ֎ʹ΋ؾΛ഑Δඞཁ͕͋Δ) • มߋͨ͠αʔϏεͷґଘؔ܎Λ೺Ѳ͠, ϩʔΧϧͰ͢΂ͯͷϓϩηεΛ্ཱͪ͛Δඞཁ͕͋Δ Isolated (ଞͷ։ൃऀΛؾʹͤͣ, ޷͖উख։ൃ͍͍ͯ͠) • ଞͷ։ൃऀΛؾʹͤͣ޷͖ͳ࣌ʹ޷͖ͳΑ͏ʹ։ൃ͍͍ͯ͠ ϚΠΫϩαʔϏε։ൃͷ࠷ॳͷεςοϓ
  8. ©2020 Wantedly, Inc. 2. ΫϥελʹσϓϩΠ͢Δ ґଘؔ܎͸ؾʹͨ͘͠ͳ͍ʂ Service C Service A

    staging cluster Service B Service B’ deploy ࣗ෼ͷมߋ͍ͨ͠ ϚΠΫϩαʔϏεʹूதͰ͖Δ
  9. ©2020 Wantedly, Inc. 2. ΫϥελʹσϓϩΠ͢Δ ґଘؔ܎͸ؾʹͨ͘͠ͳ͍ʂ Service C Service A

    staging cluster Service B Service B’ deploy ଞͷਓ͕Ϋϥελ࢖ͬͯΔ͔Β ࠓ͸มߋ͕ࢼͤͳ͍ͳ… 1ߦม͚͑ͨͩͳͷʹ σϓϩΠΛ଴ͭඞཁ͕…
  10. ©2020 Wantedly, Inc. 2. ΫϥελʹσϓϩΠ͢Δ Service C Service A staging

    cluster Service B Service B’ deploy 2. ΫϥελʹσϓϩΠ͢Δ Fast (ϑΟʔυόοΫʹ͕͔͔࣌ؒΔ) • มߋ͕DockerΠϝʔδͱͯ͠Ϗϧυ͞ΕΔͷʹ਺෼͔͔ΔͷͰ, ։ൃ͕εϜʔζʹͰ͖ͳ͍ Dependency-Agnostic (ࣗ෼ͷมߋʹूதͰ͖Δ) • ґଘؔ܎Λҙࣝͤͣ, ࣗ෼͕มߋͨ͠αʔϏεͷΈΛ࣮ߦ͢Ε͹͍͍ Isolated (ଞͷ։ൃऀʹ໎࿭Λ͔͚Δ/ड͚Δ) • ଞͷ։ൃऀͱΫϥελͷୣ͍߹͍ʹͳΔ • ޡͬͨίʔυΛσϓϩΠͨ͠৔߹ʹଞͷ։ൃऀʹ໎࿭Λ͔͚Δ/ड͚Δ ґଘؔ܎͸ؾʹͨ͘͠ͳ͍ʂ
  11. ©2020 Wantedly, Inc. 3. TelepresenceͰϩʔΧϧʹϦΫΤετΛྲྀ͢ Service C Service A Service

    B Service B’ staging cluster @potsbo’s Laptop ΋͏σϓϩΠΛ଴ͪͨ͘ͳ͍, มߋΛ͙͢ʹࢼ͍ͨ͠ʂ
  12. ©2020 Wantedly, Inc. 3. TelepresenceͰϩʔΧϧʹϦΫΤετΛྲྀ͢ Service C Service A Service

    B Service B’ staging cluster ΋͏σϓϩΠΛ଴ͪͨ͘ͳ͍, มߋΛ͙͢ʹࢼ͍ͨ͠ʂ @potsbo’s Laptop ॻ͖׵͑ΔͨͼʹΫϥελ Λ࢖ͬͯมߋΛࢼͤΔʂ
  13. ©2020 Wantedly, Inc. 3. TelepresenceͰϩʔΧϧʹϦΫΤετΛྲྀ͢ @potsbo’s Laptop Service A Service

    B staging cluster @morux2’s Laptop Service B’ Service C’ Service C ଞͷਓͷϦΫΤετ΋ྲྀΕ͠·͍ ໎࿭ʹͳͬͯ͠·͏ ΋͏σϓϩΠΛ଴ͪͨ͘ͳ͍, มߋΛ͙͢ʹࢼ͍ͨ͠ʂ
  14. ©2020 Wantedly, Inc. 3. TelepresenceͰϩʔΧϧʹϦΫΤετΛྲྀ͢ Service C Service A Service

    B Service B’ staging cluster @potsbo’s Laptop ΋͏σϓϩΠΛ଴ͪͨ͘ͳ͍, มߋΛ͙͢ʹࢼ͍ͨ͠ʂ 3. TelepresenceͰϩʔΧϧʹϦΫΤετΛྲྀ͢ Fast (ϑΟʔυόοΫ͕଎͍) • DockerΠϝʔδΛϏϧυ͢Δख͕ؒল͚ͯ, ϑΟʔυόοΫ͕͙͢ʹಘΒΕΔ Dependency-Agnostic (ࣗ෼ͷมߋʹूதͰ͖Δ) • ґଘؔ܎Λҙࣝͤͣ, ࣗ෼͕มߋͨ͠αʔϏεͷΈΛ࣮ߦ͢Ε͹͍͍ Isolated (ଞͷ։ൃऀʹ໎࿭Λ͔͚Δ/ड͚Δ) • ଞͷ։ൃऀͱΫϥελͷୣ͍߹͍ʹͳΔ • ޡͬͨίʔυΛϩʔΧϧͰಈ͔ͨ͠৔߹ʹଞͷ։ൃऀʹ໎࿭Λ͔͚Δ/ड͚Δ ΋͏σϓϩΠΛ଴ͪͨ͘ͳ͍, มߋΛ͙͢ʹࢼ͍ͨ͠ʂ
  15. ©2020 Wantedly, Inc. Fast (ϑΟʔυόοΫ͕଎͍) • DockerΠϝʔδΛϏϧυ͢Δख͕ؒল͚ͯ, ϑΟʔυόοΫ͕͙͢ʹಘΒΕΔ Dependency-Agnostic (ࣗ෼ͷมߋʹूதͰ͖Δ)

    • ࣗ෼͕มߋ͍ͨ͠෦෼ʹूதͰ͖Δ Isolated (ଞͷ։ൃऀΛؾʹͤͣ, ޷͖উख։ൃ͍͍ͯ͠) • ։ൃऀҰਓҰਓ͕ࣗ෼ઐ༻ͷΫϥελΛอ༗͍ͯ͠Δ ཧ૝ : Telepresence͕IsolatedΛຬͨͯ͠΄͍͠
  16. ©2020 Wantedly, Inc. @potsbo’s Laptop Service C Service A Service

    B potsbo’s staging cluster @morux2’s Laptop Service C Service A Service B morux2’s staging cluster NG : 1 ਓͣͭʹΫϥελΛ༩͑Δͷ͸΋͍ͬͨͳ͍ Service A͸ 2 ਓͱ΋ಉ͡΋ͷΛ࢖༻͍ͯ͠Δ Service B’ Service C’
  17. ©2020 Wantedly, Inc. άϩʔόϧʹϦΫΤετΛม͑ͣʹ, ϦΫΤετ͝ͱʹॲཧΛ੾Γସ͑Δ @potsbo’s Laptop Service A staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C ࣗ෼ͷϦΫΤετ͚͕ͩϩʔΧϧʹྲྀΕͯ΄͍͠ @morux2 ࣗ෼ͷϧʔςΟϯά͚͕ͩมߋ ͞ΕΔͷͰଞਓʹ໎࿭Λ͔͚ͳ͍ Service B
  18. ©2020 Wantedly, Inc. @potsbo’s Laptop Service A Service B staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C @morux2 ࣮૷ͷ3εςοϓ 1 2 2 3 3
  19. ©2020 Wantedly, Inc. @potsbo’s Laptop Service A Service B staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C @morux2 ࣮૷ͷ3εςοϓ ᶃ ϦΫΤετͷૹ৴ऀΛϥϕϧ෇͚͢Δ 1
  20. ©2020 Wantedly, Inc. @potsbo’s Laptop Service A Service B staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C @morux2 ࣮૷ͷ3εςοϓ ᶄ ϚΠΫϩαʔϏεؒͰϦΫΤετͷૹ৴ऀ৘ใΛ఻ൖ͢Δ 2 2
  21. ©2020 Wantedly, Inc. @potsbo’s Laptop Service A Service B staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C @morux2 ࣮૷ͷ3εςοϓ ᶅ ૹ৴ऀ৘ใΛݟͯ, ࣗ෼ͷϦΫΤετͷΈΛϩʔΧϧʹྲྀ͢ 3 3
  22. ©2020 Wantedly, Inc. @potsbo’s Laptop Service A Service B staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C @morux2 ࣮૷ͷ3εςοϓ 1 2 2 3 3 ࣮૷ͷ3εςοϓ ᶃϦΫΤετͷૹ৴ऀΛϥϕϧ෇͚͢Δ ᶄϚΠΫϩαʔϏεؒͰϦΫΤετͷૹ৴ऀ৘ใΛ఻ൖ͢Δ ᶅૹ৴ऀ৘ใΛݟͯ, ࣗ෼ͷϦΫΤετͷΈΛϩʔΧϧʹྲྀ͢
  23. ©2020 Wantedly, Inc. @potsbo’s Laptop Service A Service B staging

    cluster @morux2’s Laptop Service B’ Service C’ Service C @morux2 ࣮૷ͷ3εςοϓ 1 2 2 3 3 ࣮૷ͷ3εςοϓ ᶃૹ৴ऀ৘ใΛϦΫΤετϔομͱͯ͠෇༩͢Δ ᶄϚΠΫϩαʔϏεؒͰϔομΛ఻ൖ͢Δ ᶅϔομΛݟͯ, ࣗ෼ͷϦΫΤετͷΈΛϩʔΧϧʹྲྀ͢
  24. ©2020 Wantedly, Inc. ᶃ ೚ҙͷΞϓϦ͔ΒಛผͳϦΫΤετϔομΛૠೖͰ͖ΔσόοάΦϓγϣϯΛ࡞੒ • Chrome ExtensionΛ༻͍ͯ, ϞόΠϧ /

    ϒϥ΢β ͔Βૹ৴ऀͷϔομΛૠೖ͢Δ ᶄ αʔϏεؒͰϦΫΤετϔομΛ఻ൖ͢Δ • RubyͱGoͰϔομ఻ൖΛ࣮ݱ ᶅ ϔομͷ஋Λݟͯ, ࣗ෼ͷϦΫΤετ͚͕ͩϩʔΧϧʹྲྀΕΔΑ͏ʹ੍ޚ͢Δ • IstioͷVirtual ServiceΛ༻͍ͯ, ϦΫΤετͷಈతͳ੍ޚΛߦ͏ ۩ମతͳ࣮૷
  25. ©2020 Wantedly, Inc. ᶃ ೚ҙͷΞϓϦ͔ΒಛผͳϦΫΤετϔομΛૠೖͰ͖ΔσόοάΦϓγϣϯΛ࡞੒ • Chrome ExtensionΛ༻͍ͯ, ϞόΠϧ /

    ϒϥ΢β ͔Βૹ৴ऀͷϔομΛૠೖ͢Δ ᶄ αʔϏεؒͰϦΫΤετϔομΛ఻ൖ͢Δ • RubyͱGoͰϔομ఻ൖΛ࣮ݱ ᶅ ϔομͷ஋Λݟͯ, ࣗ෼ͷϦΫΤετ͚͕ͩϩʔΧϧʹྲྀΕΔΑ͏ʹ੍ޚ͢Δ • IstioͷVirtual ServiceΛ༻͍ͯ, ϦΫΤετͷಈతͳ੍ޚΛߦ͏ ۩ମతͳ࣮૷
  26. ©2020 Wantedly, Inc. webRequestBlocking permission Ͱ onBeforeSendHeaders Λࠩ͠ࠐΊ͹ ok Chrome

    Extension G Suite ͷΞΧ΢ϯτΛ͍࣋ͬͯΔਓͷΈʹ install ΛڐՄ͢Δ͜ͱ͕Ͱ͖Δ Staging ؀ڥ΁ͷ request ʹಛผͳ header Λ͚ͭΒΕΔΑ͏ʹ͢Δ x-wantedly-sender-id: potsbo ଞͷσόοάϑϥάΛ༗ޮʹ͢ΔϘλϯͱ͔΋͚ͭΒΕͯศར Wantedly ʹ͸΋ͱ΋ͱ͋ͬͨ
  27. ©2020 Wantedly, Inc. ᶃ ೚ҙͷΞϓϦ͔ΒಛผͳϦΫΤετϔομΛૠೖͰ͖ΔσόοάΦϓγϣϯΛ࡞੒ • Chrome ExtensionΛ༻͍ͯ, ϞόΠϧ /

    ϒϥ΢β ͔Βૹ৴ऀͷϔομΛૠೖ͢Δ ᶄ αʔϏεؒͰϦΫΤετϔομΛ఻ൖ͢Δ • RubyͱGoͰϔομ఻ൖΛ࣮ݱ ᶅ ϔομͷ஋Λݟͯ, ࣗ෼ͷϦΫΤετ͚͕ͩϩʔΧϧʹྲྀΕΔΑ͏ʹ੍ޚ͢Δ • IstioͷVirtual ServiceΛ༻͍ͯ, ϦΫΤετͷಈతͳ੍ޚΛߦ͏ ۩ମతͳ࣮૷
  28. ©2020 Wantedly, Inc. ϦΫΤετϔομͷ఻ൖ Wantedlyͷࣾ಺ϥΠϒϥϦ શϚΠΫϩαʔϏε͕͜ΕΛ࢖͍ͬͯΔ Ruby, Golang, Node, Python

    ͷ֤ݴޠ࣮૷͕͋Δ ֤ݴޠ࣮૷ʹϔομ఻ൖػߏΛ௥Ճ͍ͯͬͨ͠ servicex Log format, error collection, performance monitoring ͳͲΛ͍ͯ͠Δ servicex
  29. ©2020 Wantedly, Inc. ϔομ఻ൖ - Ruby Rack Middleware Ͱ incoming

    ͳ request ͷ header ΛಡΈऔΓ module Servicex::Context class RackMiddleware def initialize(app) @app = app end def call(env) env.each do |key, value| next unless Servicex::Context.should_propagate?(key) Servicex::Context::Store.save(key, value) end @app.call(env) ensure Servicex::Context::Store.clear! end end end ϦΫΤετฦ٫࣌ʹফ͢ Thread.current ͷ wrapper ʹ஋Λอଘ
  30. ©2020 Wantedly, Inc. module Servicex::Context class FaradayMiddleware < ::Faraday::Middleware def

    initialize(app) @app = app end def call(env) Servicex::Context::Store.keys.each do |k| env[:request_headers][k] = Servicex::Context::Store.get(k) end @app.call(env) end end end ϔομ఻ൖ - Ruby Faraday Middleware Ͱ outgoing ͳ request ʹ header Λ෇༩
  31. ©2020 Wantedly, Inc. func ContextPropagationInterceptor() func(ctx context.Context, method string, req,

    r return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.C md, _ := metadata.FromIncomingContext(ctx) for key, values := range md { if !isKeyToPropagate(key) { continue } for _, v := range values { ctx = metadata.AppendToOutgoingContext(ctx, key, v) } } return invoker(ctx, method, req, reply, cc, opts...) } } ϔομ఻ൖ - Golang Golang Ͱ͸ gRPC Λલఏʹ͍ͯ͠ΔͷͰ ctx ʹೖ͍ͬͯΔ Outgoing ͳ request ʹ෇༩͢Δ͚ͩ
  32. ©2020 Wantedly, Inc. ༨ஊ ϦΫΤετϔομͷ఻ൖ ͦͷଞͷศརͳ࢖͍ํ υϝΠϯϩδοΫʹඥ෇͔ͳ͍σόοά flag ͷ఻ൖ Accept-Language

    ͳͲͷϝλσʔλͷ఻ൖ ͨͩ͠ߗ͍ schema Λಋೖ͠ʹ͍͘ͷͰࣾ಺Ͱ࢓༷ܾΊΛ໖ີʹߦ͏΂͖
  33. ©2020 Wantedly, Inc. ᶃ ೚ҙͷΞϓϦ͔ΒಛผͳϦΫΤετϔομΛૠೖͰ͖ΔσόοάΦϓγϣϯΛ࡞੒ • Chrome ExtensionΛ༻͍ͯ, ϞόΠϧ /

    ϒϥ΢β ͔Βૹ৴ऀͷϔομΛૠೖ͢Δ ᶄ αʔϏεؒͰϦΫΤετϔομΛ఻ൖ͢Δ • RubyͱGoͰϔομ఻ൖΛ࣮ݱ ᶅ ϔομͷ஋Λݟͯ, ࣗ෼ͷϦΫΤετ͚͕ͩϩʔΧϧʹྲྀΕΔΑ͏ʹ੍ޚ͢Δ • IstioͷVirtual ServiceΛ༻͍ͯ, ϦΫΤετͷಈతͳ੍ޚΛߦ͏ ۩ମతͳ࣮૷
  34. ©2020 Wantedly, Inc. ྫ @potsboͷϦΫΤετ͸ϩʔΧϧʹྲྀ͍ͨ͠ default sender-id : postbo apiVersion:

    networking.istio.io/v1alpha3 kind: VirtualService spec: hosts: # Ϋϥελͷservice-bʹདྷͨϦΫΤετͷதͰ - service-b http: - match: # x-wantedly-sender-id:potsbo ͱ͍͏ϔομؚ͕·Ε͍ͯΔ΋ͷ͸ - headers: x-wantedly-sender-id: exact: potsbo route: - destination: host: # potsboͷϥοϓτοϓʹϧʔςΟϯά͢Δ ɹɹɹɹɹɹpotsbo-laptop - route: - destination: host: ɹɹɹɹɹɹ # ͦΕҎ֎ͷϦΫΤετ͸Ϋϥελͷservice-bʹૹΔ ɹɹɹɹɹɹ service-b if x-wantedly-sender-id : postbo then postbo’s laptop else Service B
  35. ©2020 Wantedly, Inc. ྫ 2ਓ͕ಉ࣌ʹಉ͡αʔϏεΛมߋ͍ͨ͠৔߹ 1ͭͷVirtual Serviceʹ৚݅Λ·ͱΊΔ sender-id : postbo

    default sender-id : morux2 apiVersion: networking.istio.io/v1alpha3 kind: VirtualService spec: hosts: - service-b http: - match: - headers: x-wantedly-sender-id: exact: potsbo route: - destination: host: ɹɹɹɹɹɹpotsbo-laptop http: - match: - headers: x-wantedly-sender-id: exact: morux2 route: - destination: host: ɹɹɹɹɹɹmorux2-laptop - route: - destination: host: ɹɹɹɹɹɹ service-b If x-wantedly-sender-id : postbo then postbo’s laptop if x-wantedly-sender-id : morux2 then morux2’s laptop else Service B
  36. ©2020 Wantedly, Inc. ྫ 2ਓ͕ಉ࣌ʹಉ͡αʔϏεΛมߋ͍ͨ͠৔߹ 1ͭͷVirtual Serviceʹ৚݅Λ·ͱΊΔ sender-id : postbo

    default sender-id : morux2 apiVersion: networking.istio.io/v1alpha3 kind: VirtualService spec: hosts: - service-b http: - match: - headers: x-wantedly-sender-id: exact: potsbo route: - destination: host: ɹɹɹɹɹɹpotsbo-laptop http: - match: - headers: x-wantedly-sender-id: exact: morux2 route: - destination: host: ɹɹɹɹɹɹmorux2-laptop - route: - destination: host: ɹɹɹɹɹɹ service-b If x-wantedly-sender-id : postbo then postbo’s laptop if x-wantedly-sender-id : morux2 then morux2’s laptop else Service B ධՁॱংΛ੍ޚͰ͖ͳ͍ͷͰ ֤Serviceʹෳ਺ͷVirtual Service͕ଘࡏ͠ͳ͍ ੍໿͕͋Δͱѻ͍΍͍͢
  37. ©2020 Wantedly, Inc. ΧελϜίϯτϩʔϥʔ͚͕ͩVirtual ServiceΛੜ੒͢Δ • ։ൃऀ͸Virtual ServiceΛ௚઀มߋ͢Δ୅ΘΓʹϔομ৚݅Λίϯτϩʔϥʔʹొ࿥͢Δ • ϔομ৚͕݅ొ࿥

    / ࡟আ͞ΕΔͨͼʹΧελϜίϯτϩʔϥʔ͕Virtual ServiceΛ૊Έཱͯ௚͢ Virtual ServiceΛதԝूݖతʹ؅ཧ͢Δ ։ൃऀ͸௚઀Virtual ServiceΛฤूͤͣ, ίϯτϩʔϥʔ͕։ൃऀͷཁٻΛ·ͱΊΔ
  38. ©2020 Wantedly, Inc. ։ൃऀ͸ϔομ৚݅ͷΧελϜϦιʔεΛ࡞੒͢Δ postbo apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: VSConfig spec:

    host: # ϧʔςΟϯάΛ੍ޚ͍ͨ͠k8sͷαʔϏε service-b service: # ϦΫΤετΛඈ͹͍ͨ͠ϩʔΧϧͷαʔϏε potsbo's laptop # ૹ৴ऀ͚ͩͷಛผͳϔομͷ஋ headerName: x-wantedly-sender-id headerValue: potsbo if x-wantedly-sender-id : postbo then postbo’s laptop
  39. ©2020 Wantedly, Inc. ΧελϜίϯτϩʔϥʔΛ༻͍ͨதԝूݖతͳ؅ཧ ϔομ৚͕݅CRUD͞ΕΔͨͼʹVirutal ServiceΛ 1 ͔Β࠶ੜ੒͢Δ Custom Controller

    sender : postbo default sender : morux2 postbo default morux2 else if … then if … then else if … then if … then
  40. ©2020 Wantedly, Inc. • ෳ਺ਓͰ 1 ͭͷϦιʔεΛ৮Βͳ͍ͷͰ, Isolated͕ຬͨ͞ΕΔ • ։ൃऀ͸ಠࣗͷϔομ৚݅Λ࡞੒͢ΔͷͰίϯϑϦΫτ͸ى͖ͳ͍

    • ηϧϑώʔϦϯάͰ͖Δ • ϔομ৚͔݅Β 1 ํ޲ͰVirtual Serivce͕ੜ੒͞ΕΔͷͰ, յΕͯ΋ࣗಈͰݩʹ໭Δ • શͯͷVirtual ServiceͰϑΥʔϚοτΛ౷Ұ͢Δ͜ͱ͕Ͱ͖Δ • ΨϕʔδίϨΫγϣϯָ͕Ͱ͋Δ • ͦΕͧΕͷϔομ৚໊͕݅લ΍ϝλσʔλ(ੜ੒೔ͳͲ)Λ࣋ͭ͜ͱ͕Ͱ͖ͯ࡟আ͕༰қͰ͋Δ ΧελϜίϯτϩʔϥʔΛ༻͍ͨதԝूݖతͳ؅ཧ ։ൃऀ͸௚઀Virtual ServiceΛฤूͤͣ, ίϯτϩʔϥʔ͕։ൃऀͷཁٻΛ·ͱΊΔ
  41. ©2020 Wantedly, Inc. • ෳ਺ਓ͕ಉ࣌ʹVirtual ServiceΛฤूͯ͠͠·͏ • ίϯϑϦΫτ͕ى͖ͯ, ଞͷ։ൃऀ͕ϔομ৚݅Λొ࿥Ͱ͖ͳ͍͔΋͠Εͳ͍ •

    ηϧϑώʔϦϯά͕Ͱ͖ͳ͍ • յΕͯ͠·ͬͨ࣌ʹ௚͢ͷ͕େมͰ͋Δ • શͯͷVirtual Serviceʹಉ༷ͷมߋΛՃ͍͑ͨࡍʹख͕͔͔ؒΔ • ΨϕʔδίϨΫγϣϯͷख͕͔͔ؒΔ • ΫϥελΛ࢖༻͠ऴΘͬͨࡍʹVirtual ServiceΛݩʹ໭͢ͷ͕໘౗Ͱ͋Δ k8sͷpatchϦΫΤετΛ༻͍ͨ෼ࢄ؅ཧ͸ͩΊ͔ ӡ༻͸ՄೳͰ͋Δ͕͋·Γݎ࿚Ͱ͸ͳ͍, खؒ΋ଟ͔͔͘Δ
  42. ©2020 Wantedly, Inc. ݁ہ։ൃऀମݧ͸ʁ ࣾ಺ kubectl wrapper ͷ kube Ͱ

    wrap Ͱ͖ΔΑ͏ʹ͢Δ https://speakerdeck.com/potsbo/kube-the-core-tool-at-wantedly
  43. ©2020 Wantedly, Inc. ݁ہ։ൃऀମݧ͸ʁ kube ίϚϯυͰ؆୯ʹΫϥελΛίϐʔͰ͖Δ $ kube fork kube

    ίϚϯυͰ؆୯ʹΫϥελΛίϐʔ͢Δ αʔόʔΛىಈ͢Δ $ bin/rails server Chrome ͔ΒΞΫηε Extension ͔Β sender-id Λઃఆ ͲΕ͚ͩґଘ͕͋ͬͯ΋ଞʹ͸Կ΋͠ͳ͍͍ͯ͘ ͍ͭͰ΋ؾʹͤͣ࢖͍͍ͬͯ
  44. ©2020 Wantedly, Inc. தͰ΍͍ͬͯΔ͜ͱ ͦͷ Service ʹ Routing Ͱ͖Δϔομ৚݅ (VSConfig)

    Λ࡞Δ Telepresence Λىಈ͢Δ ͦͷ Telepresence Pod ʹ Routing Ͱ͖Δ Service Λ࡞Δ ؀ڥม਺ΛΫϥελ͔Βμ΢ϯϩʔυ ىಈ࣌ ऴྃ࣌ Telepresence Λऴྃ ࡞੒ͨ͠ Service ͱ VSConfig Λ࡟আ
  45. ©2020 Wantedly, Inc. ͱ͸͍࣮͑ࡍʹ͸… Gateway ͔ Ambassador ͷΑ͏ͳϨΠϠʔ͕ඞཁʹͳΔ ࣾ಺ͷίϯϕϯγϣϯʹै͍ͬͯͳ͍ microservice

    ͷྫ֎ରԠ͕଍Γ͍ͯͳ͍ ඇಉظ job ͳͲͰϔομʔ఻೻్͕੾ΕΔࣄ͕͋Δ Ϋϥελ಺؀ڥม਺Λ࢖͏ͱRAILS_ENV Λ͏·͘΍Βͳ͍ͱ dev server ͕ىಈ͠ͳ͍ ໰୊͸ࢁੵΈͳͷͰࣾ಺άϩʔε׆ಈத Ͳͷ service ʹର͢Δ virtual service Λఆٛͨ͠ΒΑ͍͔Λ஌͍ͬͯΔඞཁ͕͋Δ
  46. ©2020 Wantedly, Inc. ·ͱΊ Fast, Dependency-Agnostic, Isolated WHY Telepresence +

    Istio + ϔομ఻ൖ HOW WHAT όʔνϟϧࣗ෼ઐ༻Ϋϥελͷମݧ
  47. ©2020 Wantedly, Inc. ༨ஊ servicex, kube, istio, ϔομ఻೻ͳͲ͸ طʹଞͷ՝୊ʹ౤ೖ͍ͯͨͨ͠Ίָͩͬͨ ٕज़ج൫͸ੵΈॏͶ

    ͨͩ͠ઌΛݟ௨͢ͷ΋େࣄ ࠓճͷϓϩδΣΫτ΁ͷྲྀ༻Λݟ௨্ͨ͠Ͱ ্هͷίϯϙʔωϯτ͸࡞͍ͬͯͨ