Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Copy Kubernetes Clusters Really Fast
Search
Shimpei Otsubo
March 11, 2021
Technology
5.3k
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
940
Deploy Flow at Wantedly
potsbo
2
1.1k
Wrap every method with just one line
potsbo
1
5.7k
Zero yen Keyboard
potsbo
6
3.4k
Kube - The core tool at Wantedly
potsbo
1
8.5k
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
購入ドメインでの課題と取り組み
ykagano
0
150
Lambda MicroVMsが分からなすぎたので使い所を1から考えてみた
tsukuboshi
2
420
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
160
Kernel testing frameworks
ennael
PRO
0
110
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
140
FactoryBotアンチパターン / factory_bot anti-patterns
toshimaru
0
140
メルペイ 会計システム概要と歴史
mewuto
0
190
Deep Data Security 機能解説
oracle4engineer
PRO
2
720
IoTデバイスを繋げるプロトコルMatterをAndroidで使用する方法
harutiro
0
120
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
310
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
560
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.1k
Featured
See All Featured
Music & Morning Musume
bryan
48
7.4k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
970
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
550
Accessibility Awareness
sabderemane
1
240
Navigating Team Friction
lara
192
16k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
A Tale of Four Properties
chriscoyier
163
24k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
580
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
770
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Visualization
eitanlees
153
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
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ָʹͳΔ ·ͱΊ ج൫ΛੵΈ্͍͛ͯ͜͏