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
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
730
Screen Lens - 今見てる画面を翻訳する
komagata
0
300
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
150
データ_AIの事業の勝敗をわけるもの
nek0128
0
360
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
4
1.7k
日経電子版を支えていく Kasane Design System/fec_fukuoka
nikkei_engineer_recruiting
0
1.5k
What the customer really needed
kawaguti
PRO
2
180
Spring BootからQuarkusへの移行
tatsuya1bm
2
120
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
810
LTのテーマ どうきめてる?〜5つの型と私のやり方〜
yama3133
1
110
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
HHKBエバンジェリストになる方法
941
0
100
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
22k
Scaling GitHub
holman
464
140k
Optimising Largest Contentful Paint
csswizardry
37
4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
A Soul's Torment
seathinner
8
3.6k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
RailsConf 2023
tenderlove
30
1.5k
We Have a Design System, Now What?
morganepeng
55
8.3k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
420
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ָʹͳΔ ·ͱΊ ج൫ΛੵΈ্͍͛ͯ͜͏