Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Copy Kubernetes Clusters Really Fast
Search
Shimpei Otsubo
March 11, 2021
Technology
5.2k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Copy Kubernetes Clusters Really Fast
Shimpei Otsubo
March 11, 2021
More Decks by Shimpei Otsubo
See All by Shimpei Otsubo
Go と Wantedly の関係 / How Wantedly uses Go
potsbo
1
910
Deploy Flow at Wantedly
potsbo
2
1.1k
Wrap every method with just one line
potsbo
1
5.6k
Zero yen Keyboard
potsbo
6
3.3k
Kube - The core tool at Wantedly
potsbo
1
8.3k
k8s - Kubernetes 8 Factors
potsbo
12
11k
コンテンツ作成に集中するためのプレゼンテーション Tips / Presentation with Confidence
potsbo
7
42k
ConfigMap vs Secret #k8sjp
potsbo
1
1.5k
Microservices on Kubernetes
potsbo
5
12k
Other Decks in Technology
See All in Technology
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
3
500
AIプラットフォームを運用し続けるための可観測性
tanimuyk
4
1.2k
Agentic Defenseとともにセキュリティエンジニアが輝き続けるには / How Security Engineers Can Keep Excelling with Agentic Defense
yuj1osm
0
140
"何を作るか"を任される エンジニアは、どう育つのか
yutaokafuji
1
270
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
310
AI駆動開発が変える、大規模開発の前提 ーHuman in the Loop から Human on the Loop へ / AIE2026
visional_engineering_and_design
30
22k
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
960
Rubyで音を視る
ydah
1
230
noUncheckedIndexedAccess、3時間、1万円。 / noUncheckedIndexedAccess, 3 Hours, 10,000 JPY.
kaonavi
1
340
MCP Appsを作ってみよう
iwamot
PRO
4
300
チームで進めるAI駆動アジャイル×ウォーターフォール
kumaiu
0
120
実装は速くなった、レビューはどうする? ― 自身のレビューをAIで再現させるサーヴァントエンジニアリングのすゝめ / Implementation got faster. So what about reviews? — An invitation to Servant Engineering: Recreating your own code reviews with AI
nrslib
7
4.4k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Designing for Timeless Needs
cassininazir
1
250
Documentation Writing (for coders)
carmenintech
77
5.4k
The Curse of the Amulet
leimatthew05
1
13k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
570
Odyssey Design
rkendrick25
PRO
2
690
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
340
Side Projects
sachag
455
43k
Code Reviewing Like a Champion
maltzj
528
40k
Designing for humans not robots
tammielis
254
26k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Done Done
chrislema
186
16k
Transcript
©2021 Wantedly, Inc. Kubernetes Cluster Λ Copy ޙΖଆͷ Microservice ͷ
Review ؆୯ʹ CloudNative Days Spring 2021 ONLINE Mar 11, 2020 - Shimpei Otsubo @potsbo
Shimpei Otsubo @potsbo Developer eXperience Squad Wantedly, Inc. Kubernetes Dev
Tools CI / CD AuthN / Z Productivity Dvorak
©2021 Wantedly, Inc. Developer eXperience Squad ͱʁ ྑ͍։ൃମݧ͕ྑ͍ϓϩμΫτͱձࣾΛ࡞Δ ։ൃମݧͷͨΊͳΒԿͰ͢Δ ։ൃ࣌ؒͷ30%ఔͰϓϩμΫτ։ൃʹճΔ
Backend, Frontend, Infrastructure, Mobile ͳͲΛΘͳ͍ උͨ͠ج൫ͷυοάϑʔσΟϯά / ʮ։ൃऀ͕ຊʹٻΊ͍ͯΔͷͳʹ͔?ʯΛߟ͑Δ ֎෦ʹٕज़ج൫νʔϜͱհ͢Δ͜ͱଟ͍ ߴ͔ͭ҆શͳ deploy ϓϩμΫτͱ৫Λͤ͞Δ ٕज़ࢿͱͷલͷϓϩμΫτͷ༏ઌॱҐΛߟ͑ΔλΠϛϯάΛ࣋ͪଓ͚Δ ίʔυΛॻ͔ͳ͍ղܾࡦࢹʹೖΕΔ 10ޙͷ։ൃͷৗࣝΛ࡞͍͚ͬͯΔνʔϜʹ͍ͨ͠
©2021 Wantedly, Inc. TL;DR Istio + Ambassador Λͬͯ Ծతͳ Kubernetes
ͷ copy Λ࣮ݱ ͜ΕʹΑͬͯ։ൃମݧ͕ΨϥοͱมΘΔ
©2021 Wantedly, Inc. ߴͰޮతͳΫϥελ copy ͕͍ͨ͠ Copy on Write ͰԾΫϥελΛ࡞Δ
Ԡ༻ͱಘΒΕͨମݧ WHY HOW WHAT
©2021 Wantedly, Inc. WHY Microservice ͷґଘղܾΛ͠ͳͯ͘ྑ͍ ߴͰޮతͳΫϥελ copy ͕͍ͨ͠ Preview
URL Λ࡞ΕΔ Photo by Jørgen Håland on Unsplash
©2021 Wantedly, Inc. ϙνϙν͔ͯ֬͠Ί͍ͨ͜ͱΑ͋͘Δ UI มߋͳΒͪΖΜ ΞϧΰϦζϜͷมߋ࣮σʔλͰݟͯΈ͍ͨ
©2021 Wantedly, Inc. Preview Deployment ੲ͔ΒΑ͋͘Δ https://vercel.com/docs/git/vercel-for-github Vercel, Heroku, Netlify
νʔϜશһͰಉ͡ͷΛݟΕΔ ຊ൪ʹ͍ۙঢ়ଶ ϫϯΫϦοΫͰ֬ೝ ࠷ۙͷ PaaS ʹී௨ʹ͋Δػೳ ىಈํ๏ΛΒͳ͍͍ͯ͘ ΞϓϦέʔγϣϯͷશମ૾͢ΒΒͳ͍͍ͯ͘ ։ൃ build Ͱ͔͠ى͖ͳ͍ʹϋϚͬͨΓ͠ͳ͍ ԶͷPCͰಈͧ͘ʁͱ͔ى͜Βͳ͍ ࣮σʔλΛ͑ͨΓ͢Δ Kubernetes ্Ͱ࣮ݱ͢Δ OSS ͋Δ
©2021 Wantedly, Inc. Microservice Ͱ؆୯Ͱͳ͍ ཪଆͷ Microservice ʹͲ͏ͬͯ౸ୡ͢Δ͔ʁ ཪଆʹܨ͍Ͱ integration
ͨ͠ঢ়ଶͰͷ test ͕Ͱ͖ͳ͍ Wantedly Ͱͱͱ͜ͷχʔζʹڞ༗ڥʹ deploy ͢Δ͜ͱͰ͍ͬͯͨ Ұ൪ front ʹཱͭ service ͳΒ؆୯ ޙΖଆʹཱͭ service ʹ؆୯ʹ౸ୡͰ͖ͳ͍ ޙΖଆ͚͕ͩҧ͏ front ͷ microservice ΛͲ͏ͬͯ࡞Γग़͔͢ʁ ͜͜ͷ Routing Ͳ͏Δͷʁ
©2021 Wantedly, Inc. Microservice Ͱ؆୯Ͱͳ͍ ඞཁͳ͚ͩ copy ͠Α͏ͱ͢Δͱͦͷґଘղܾ͕ͦͦେม Microservice ͷ
interface ͷઌΛҙࣝͨ͘͠ͳ͍ Wantedly Ͱͱͱ͜ͷχʔζʹڞ༗ڥʹ deploy ͢Δ͜ͱͰ͍ͬͯͨ ͜Ε͕ࣗ໌ʹͳΔΑ͏ͳ architecture Λࢦ͖͢ͱ͍͏͋Δ
©2021 Wantedly, Inc. Kubernetes Cluster Λ copy ͢Ε ok! ґଘؔউखʹͯ͢ຬͨ͞ΕΔ
ཪଆ͚ͩҧ͏ঢ়ଶΛશʹ࠶ݱ Wantedly ͷ߹શ microservice 140ݸ͕ 1 cluster ʹଘࡏ Microservice Ͱ Preview ͕Ͱ͖ΔΑ͏ʹͳΔ https://speakerdeck.com/morux2/istio-integrated-telepresence https://event.cloudnativedays.jp/cndt2020/talks/17 ͜ͷลͷϞνϕʔγϣϯલճৄ͘͠
©2021 Wantedly, Inc. Kubernetes Cluster Λ copy ͢Ε ok! ຊʹͦΜͳ͜ͱͰ͖Δͷ͔
Wantedly ͷ߹શ microservice 140ݸ͕ 1 cluster ʹଘࡏ
©2021 Wantedly, Inc. Context Propagation Service Mesh Gateway Header Λൖ
Header Ͱ Routing Host Λ Header ʹม HOW Copy on Write Ͱ Virtual Copy Photo by Alina Grubnyak on Unsplash
©2021 Wantedly, Inc. ԾతͳΫϥελ copy πʔϧ kubefork Λ࡞ͬͨ ڞ༗Ͱ͖Δͱ͜Ζڞ༗ Copy
on Write ͯ͢ Copy ͢Δͱ N * D ඞཁͳͱ͜Ζ͚ͩͩͱ N + D ޮత ҟͳΔ෦͚ͩஔ͖͑ N: microservice , D: ։ൃऀ 4 microservice ߏʹ2ͭͷ copy Λੜͨ͠߹ શ෦࣮ copy ͩͱ node ͕ͪൃੜ ߴ OSS ʹ͍͚ͨ͠Ͳؒʹ߹ͬͯͳ͍ Deployment ͱ service ͷΈ
©2021 Wantedly, Inc. Terminology Ծతʹ copy ͞ΕͨΫϥελ Virtual Cluster Virtual
Cluster Λಛఆ͢Δ id Fork Identifier Ұͭͷ fork identifier Λ࣋ͭ Shared ͳ cluster Λͱʹ Fork ͢Δ 4 microservice ߏʹ2ͭͷ copy Λੜͨ͠߹ Virtual Cluster Λੜ͢Δ
©2021 Wantedly, Inc. Terminology Ծతʹ copy ͞ΕͨΫϥελ Virtual Cluster Virtual
Cluster Λಛఆ͢Δ id Fork Identifier Ұͭͷ fork identifier Λ࣋ͭ Shared ͳ cluster Λͱʹ Fork ͢Δ 4 microservice ߏʹ2ͭͷ copy Λੜͨ͠߹ Virtual Cluster Λੜ͢Δ
©2021 Wantedly, Inc. Terminology Ծతʹ copy ͞ΕͨΫϥελ Virtual Cluster Virtual
Cluster Λಛఆ͢Δ id Fork Identifier Ұͭͷ fork identifier Λ࣋ͭ Shared ͳ cluster Λͱʹ Fork ͢Δ 4 microservice ߏʹ2ͭͷ copy Λੜͨ͠߹ Virtual Cluster Λੜ͢Δ
©2021 Wantedly, Inc. Terminology Ծతʹ copy ͞ΕͨΫϥελ Virtual Cluster Virtual
Cluster Λಛఆ͢Δ id Fork Identifier Ұͭͷ fork identifier Λ࣋ͭ Shared ͳ cluster Λͱʹ Fork ͢Δ 4 microservice ߏʹ2ͭͷ copy Λੜͨ͠߹ Virtual Cluster Λੜ͢Δ
©2021 Wantedly, Inc. Wildcard DNS Ͱ upstream ΛଋͶΔ Gateway Request
Λదͳ copy ઌૹΔ Service Mesh ߏཁૉ Context Propagation fork identifier Λ header ͱͯ͠ൖ 4 microservice ߏʹ2ͭͷ copy Λੜͨ͠߹ Ͳͷ Virtual Cluster ༻ͷ request? ମײ৽͍͠ host ͷΞΫηε
©2021 Wantedly, Inc. Context Propagation ʮͲͷ Virtual Cluster ʹ͚ΒΕͨͷ͔ʯΛRequest ͝ͱʹཧ
e.g. X-Fork-Identifier: forked-a ࣾڞ௨ϥΠϒϥϦ servicex Ͱ࣮ݱ Feature Flag ͳͲԠ༻৭ʑ X-Feature-Flags: {"name": "new_feature?": "enabled": true} e.g. ޙΖଆͷ microservice ͷ new-feature Λ༗ޮʹͨ͠ঢ়ଶ͕ݟ͍ͨͱ͖ʹ HTTP header Λൖ͢Δ͜ͱͰ request ͝ͱͷॲཧΛ؆୯ʹՃͰ͖ΔΑ͏ʹͳΔ ಛఆͷ Prefix Λ࣋ͭ header / metadata ΛࣗಈͰൖ ޙड़ Ͳͷ Microservice ؒ௨৴ͰʮѼઌClusterʯ͕໌ࣔతʹͳΔ https://www.wantedly.com/companies/wantedly/post_articles/311135
©2021 Wantedly, Inc. ༨ஊ: Metadata ͷ͍͗͢ʹҙ ൖ͍ͨ͠ͷ͍ͬͺ͍͋Δ UserId, Country, Language
ͳͲޙΖଆͷ server Ͱཉ͘͠ͳΔ͜ͱΑ͋͘Δ ෦͚: wantedly/dev#412 ్தܦ࿏ͷͯ͢ͷ schema ʹੜ͍ͯ͘͠Έ͍ͨͳͷਏ͍ ৴༻Ͱ͖Δ͔Θ͔Βͳ͍ Schema ʹݱΕʹ͘͘ͳΔ Debug తڐ༰ ʮProto ͷ௨Γʹ request ͨ͠Β header ͕Γͣʹ͔ΕΔʯͱ͔͕ىͬͯ͜͠·͏ ৴༻͍ͨ͠߹֎෦͔Β inject Ͱ͖ͳ͍Έ͕ඞཁ ʮX-Current-User-Id ΛͱʹೝՄͯ͠Α͍ʯͱ͍͏ policy ͔ͳΓ৻ॏʹ Metadata proto ʹ serialize ͢Δͱ͍͏ΞΠσΞ͋Δ(ະ࣮) ຊ൪ͰΕྑ͍͠ɺabuse ͞Εͯக໋తͰͳ͍
©2021 Wantedly, Inc. Service Mesh ࠓ͍Δ Virtual Cluster ʹ߹Θͤͨ routing
Header ʹԠͯ͡ request ઌΛม͑Δ e.g. X-Fork-Identifier: forked-a ֎͔ΒݟΔͱ࣮࣭ copy ڞ༗͍ͯ͠Δ microservice ෳ͋ΔΑ͏ʹݟ͑Δ ͬͪ͜ͷ path Λ௨͍ͬͯΔΑ͏ʹײ͡Δ ͨͩ͠Ӆṭ͕ॏཁ Service mesh Λҙࣝ͢Δͱ copy ʹײ͡ͳ͘ͳΔ ͋͑ͯʮcopy ͕Ͱ͖Δʯ͑ͨ΄͏͕ΘΕΔ Έ͔Βઆ໌͢Δͱ͍͠ͱײ͡ΒΕͯ͠·͏
©2021 Wantedly, Inc. Gateway Host ʹ߹Θͤͯ header Λ༩ Wildcard DNS
͕͍ͨ proxy ʮCopy ͞ΕͯΔײʯʹॏཁ fork-a.example.com Έ͍ͨͳ URL ͕ൃߦ͞ΕΔ ֎͔ΒݟΔͱʮcopy ͞Ε࣮ͨଶʯ ʮURL ͕ൃߦͰ͖Δʯ͜ͱ͕ϝϯλϧϞσϧߏஙʹྑ͍ Wantedly Ͱ͜ͷػೳ͕Ͱ͖Δ·Ͱܟԕ͞Ε͕ͪͩͬͨ Routing ͷ͠͞ΛӅṭ ͜͜ʹଓ͍ͯ͠Δؾ࣋ͪʹͳΕΔ URL ͕͋Δͱڞ༗͕Ͱ͖Δ ࣗͷมߋΛଞͷਓʹ৮ͬͯΒ͑Δ Mobile ͔ΒମݧΛ͔֬ΊΔ
©2021 Wantedly, Inc. 20209݄࣌Ͱ Chrome Extension ͷΈͷରԠͩͬͨ ࠓͲ͜ʹܨ͍Ͱ͍Δͷ͔ʁ͕͔ΓͮΒ͔ͬͨ https://speakerdeck.com/morux2/istio-integrated-telepresence?slide=44 Gateway
Host ʹ߹Θͤͯ header Λ༩ Wildcard DNS ͕͍ͨ proxy ʮCopy ͞ΕͯΔײʯʹॏཁ fork-a.example.com Έ͍ͨͳ URL ͕ൃߦ͞ΕΔ ֎͔ΒݟΔͱʮcopy ͞Ε࣮ͨଶʯ ʮURL ͕ൃߦͰ͖Δʯ͜ͱ͕ϝϯλϧϞσϧߏஙʹྑ͍ Wantedly Ͱ͜ͷػೳ͕Ͱ͖Δ·Ͱܟԕ͞Ε͕ͪͩͬͨ Routing ͷ͠͞ΛӅṭ URL ͕͋Δͱڞ༗͕Ͱ͖Δ ࣗͷมߋΛଞͷਓʹ৮ͬͯΒ͑Δ Mobile ͔ΒମݧΛ͔֬ΊΔ Chrome Ҏ֎ͰରԠͰ͖ͳ͔ͬͨ
©2021 Wantedly, Inc. Context Propagation Service Mesh Gateway Header Λൖ
Header Ͱ Routing Host Λ Header ʹม HOW Copy on Write Ͱ Virtual Copy Photo by Alina Grubnyak on Unsplash
©2021 Wantedly, Inc. ࣮ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: Fork metadata: name:
wantedly-some-identifier namespace: wantedly spec: identifier: some-identifier manager: fork-proxy-ambassador/default services: selector: matchLabels: role: web deployments: selector: matchLabels: newrelic: "true" template: metadata: labels: app: some-identifier role: fork annotations: wantedly.com/deploy-target: "false" spec: containers: - image: example:tag name: wantedly CRD Ͱ atomic ͳॲཧʹݟͤΔ
©2021 Wantedly, Inc. ࣮ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: Fork metadata: name:
wantedly-some-identifier namespace: wantedly spec: identifier: some-identifier manager: fork-proxy-ambassador/default services: selector: matchLabels: role: web deployments: selector: matchLabels: newrelic: "true" template: metadata: labels: app: some-identifier role: fork annotations: wantedly.com/deploy-target: "false" spec: containers: - image: example:tag name: wantedly some-identifer ͱ͍͏ id Ͱ cluster ൃߦΛґཔ CRD Ͱ atomic ͳॲཧʹݟͤΔ
©2021 Wantedly, Inc. ࣮ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: Fork metadata: name:
wantedly-some-identifier namespace: wantedly spec: identifier: some-identifier manager: fork-proxy-ambassador/default services: selector: matchLabels: role: web deployments: selector: matchLabels: newrelic: "true" template: metadata: labels: app: some-identifier role: fork annotations: wantedly.com/deploy-target: "false" spec: containers: - image: example:tag name: wantedly some-identifer ͱ͍͏ id Ͱ cluster ൃߦΛґཔ Namespce Ͱ copy ͢Δ͖ service Λࢦఆ CRD Ͱ atomic ͳॲཧʹݟͤΔ
©2021 Wantedly, Inc. ࣮ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: Fork metadata: name:
wantedly-some-identifier namespace: wantedly spec: identifier: some-identifier manager: fork-proxy-ambassador/default services: selector: matchLabels: role: web deployments: selector: matchLabels: newrelic: "true" template: metadata: labels: app: some-identifier role: fork annotations: wantedly.com/deploy-target: "false" spec: containers: - image: example:tag name: wantedly some-identifer ͱ͍͏ id Ͱ cluster ൃߦΛґཔ Namespce Ͱ copy ͢Δ͖ service Λࢦఆ ͦͷ service ͔Β route ͞ΕΔ deploy Λ list ͯ͠ߋʹ੍ݶ CRD Ͱ atomic ͳॲཧʹݟͤΔ
©2021 Wantedly, Inc. ࣮ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: Fork metadata: name:
wantedly-some-identifier namespace: wantedly spec: identifier: some-identifier manager: fork-proxy-ambassador/default services: selector: matchLabels: role: web deployments: selector: matchLabels: newrelic: "true" template: metadata: labels: app: some-identifier role: fork annotations: wantedly.com/deploy-target: "false" spec: containers: - image: example:tag name: wantedly some-identifer ͱ͍͏ id Ͱ cluster ൃߦΛґཔ Namespce Ͱ copy ͢Δ͖ service Λࢦఆ ͦͷ service ͔Β route ͞ΕΔ deploy Λ list ͯ͠ߋʹ੍ݶ pod template ͷ patch Λ copy ʹͯΔ CRD Ͱ atomic ͳॲཧʹݟͤΔ
©2021 Wantedly, Inc. ࣮ CRDͰදݱ Gateway Service Mesh Copy ੜ
CRD͔ΒશͯΛੜ
©2021 Wantedly, Inc. ࣮ apiVersion: getambassador.io/v2 kind: Mapping metadata: labels:
fork.k8s.wantedly.com/manager: default name: some-dev-wantedly-com-some-identifier namespace: fork-proxy-ambassador spec: add_request_headers: x-fork-identifier: some-identifier ambassador_id: - fork-proxy-ambassador host: some-identifier.some-dev.wantedly.com prefix: / service: https://some-dev.wantedly.com Gateway ͱͯ͠ͷ Mapping ੜ ൖ͢Δ header ΛՃ ಛఆͷ host ͱͯ͠ request ͕དྷͨΒ ਖ਼͍͠ upstream ʹଓ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: ForkManager metadata: name: default namespace: fork-proxy-ambassador spec: upstreams: - host: "some-dev.wantedly.com" - host: "another-dev.wantedly.com" - host: "yet-another-dev.wantedly.com" - host: … Cluster ͷೖΓޱΛ༧Ί list ͓ͯ͘͠ Upstreams * Virtual Cluster ͷͷ mapping ͕ੜ͞ΕΔ ಉ͜͡ͱ͕Ͱ͖Ε Ambassador ͡Όͳ͍͍ͯ͘
©2021 Wantedly, Inc. WHAT Telepresence ͠์ Copy ͞Εͨ virtual cluster
ͰԿΛͬͯ୭ʹ໎Λ͔͚ͳ͍ Feature Flag ͝ͱʹ؆୯ʹ URL Λൃߦ Pull Request Preview URL ͲΜͳʹޙΖଆͷ Microservice Ͱ ok Pull Request Λ࡞ͬͨΒͦΕ͕ Preview Ͱ͖Δ URL ͕ൃߦͰ͖Δ new-feature-released.dev.example.com Έ͍ͨͳ URL ͕؆୯ʹ࡞ΕΔ Virtual cluster ͷͯ͢ͷ request Λ local ʹૹͬͯେৎ ͔͠Ճͷܭࢉࢿݯ͕Ұ͍Βͳ͍ Photo by SpaceX on Unsplash Ԡ༻ͱಘΒΕͨମݧ
©2021 Wantedly, Inc. Telepresence ͠์ Virtual cluster ͰԿͰ͋Γ ࣗઐ༻ͷڥͩͱײ͡ΒΕΔ Telepresence
ͯ͠େৎ ڞ༗ΫϥελͰ͏ͱଞͷਓͷ request ٵ͍ࠐΉ όάͬͨͷΛىಈͯ͠େৎ https://speakerdeck.com/morux2/istio-integrated-telepresence?slide=33 Virtual ͳΒࣗͷ request ͚ͩͳͷͰ҆શ ͜ͷ༻్ʹ͍ͭͯલճͷൃද͕ৄ͍͠
©2021 Wantedly, Inc. Feature Flag ͝ͱʹ؆୯ʹ URL Λൃߦ αʔόʔͷҙͷڍಈΛ override
Ͱ͖Δج൫Λ͍࣋ͬͯͨ શͯͷ AB test ໌ࣔతʹ annotate ͨ͠ͷ Rails ͷ ҙͷHelper ͷҙͷ method X-Feature-Flags: {"name": "new_feature?": "enabled": true} Header ΛૹΓ͚ͭΔ͚ͩͰྑ͍ ൖ͞Ε͍ͯΔͷͰޙΖଆͷ microservice ͷڍಈม͑ΒΕΔ Assets ͚ͩखݩͷ webpack-dev-server Λ͏ ༗༻ͳ Debug πʔϧ AB test ͷಛఆͷ variant Ͱදࣔ͢Δ ϦϦʔεલͷػೳΛ৮Δ Host / Header มج൫ͱͯ͠ͷ Gateway Λ༗ޮར༻ https://speakerdeck.com/potsbo/wrap-every-method-with-just-one-line ؆୯ʹ Header ΛՃͰ͖Δ Chrome Extension Λ࡞͍ͬͯͨ
©2021 Wantedly, Inc. Feature Flag ͝ͱʹ؆୯ʹ URL Λൃߦ Gateway ͱ
integrate some.wantedly.com some-dev.wantedly.com new-feature-released.some-dev.wantedly.com ຊ൪ ։ൃ NEW!! Host / Header มج൫ͱͯ͠ͷ Gateway Λ༗ޮར༻ apiVersion: vsconfig.k8s.wantedly.com/v1beta1 kind: Fork metadata: name: new-feature-enabled namespace: wantedly spec: identifier: new-feature-enabled manager: fork-proxy-ambassador/default gatewayOptions: addRequestHeaders: x-feature-flags: '{"name": "new_feature?": "enabled": true}' Feature Flag Header Λૠೖ Resourceফඅ͕օແ Virtual Cluster ͍ग़͞ΕΔ ͜ͷͨΊ URL ͍ग़͞ΕΔ ͔͠͠৽نͷ pod Ұͳ͍
©2021 Wantedly, Inc. Pull Request Preview URL Microservice Ͱ Preview
Ͱ͖Δ ͲΜͳʹޙΖଆͷ Microservice Ͱ࣮ࡍͷ UI ͔Β࣮֬ʹ౸ୡͰ͖Δ ※·ͩͯ͠ͳ͍ͷͰΠϝʔδͰ͢… σβΠφͱͷ Review εϜʔζʹͳΔ Microservice ؔͳͯ͘ศར GitHub ͷ webhook ʹ߹Θͤͯ fork Λ࡞Δ͚ͩ
©2021 Wantedly, Inc. Pull Request Preview URL GitHub ͷ webhook
ʹ߹Θͤͯ fork Λ࡞Δ͚ͩ
©2021 Wantedly, Inc. ࠷ޙʹ༨ஊ ج൫ੵΈ্͛ Context Propagation ࣾڞ௨ϥΠϒϥϦ͕͔͋ͬͨΒ࡞Εͨ ൖͱͱ Feature
Flag ༻ͷج൫ͩͬͨͷΛ͍·Θͨ͠ Istio / Ambassador ͕ेݕূ͞ΕͯಋೖࡁΈͩͬͨ ݹ͍αʔϏεશͯ Kubernetes ʹҠߦ͖͍ͬͯͨ͠ Deployment Λ Copy ͢Δ CRD ͕࡞ࡁΈͩͬͨ શ෦ Terraform ͔ͩͬͨΒূ໌ॻ/DNSΛҰؾʹ૿ͤͨ …
©2021 Wantedly, Inc. Context Propagation Service Mesh Gateway Header Λൖ
Header Ͱ Routing Host Λ Header ʹม Կ͔ͱ͋Δͱศརͳ3ͭͷج൫ Photo by Alina Grubnyak on Unsplash
©2021 Wantedly, Inc. ʮCluster Copy ͱ͍͏நԽʯ͕͋Δͱ ։ൃϨϏϡʔQAָʹͳΔ ·ͱΊ ج൫ΛੵΈ্͍͛ͯ͜͏