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.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
930
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.4k
Kube - The core tool at Wantedly
potsbo
1
8.4k
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
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
トヨタ⽣産⽅式(TPS)⼊⾨
recruitengineers
PRO
3
930
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
210
PLATEAU で バーチャル花火大会
tatsuya1970
0
160
Webアクセシビリティ入門 2026
recruitengineers
PRO
3
630
つくって納得、つかって実感! 大規模言語モデルことはじめ ver2.0
recruitengineers
PRO
5
1.8k
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
240
会社紹介資料 / Sansan Company Profile
sansan33
PRO
24
430k
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
ラジオの科学
frievea
0
330
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
270
Goでデータパイプラインを作ろう
sansantech
PRO
1
490
Featured
See All Featured
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
470
Tell your own story through comics
letsgokoyo
1
1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
The Spectacular Lies of Maps
axbom
PRO
1
910
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
300
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
430
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Paper Plane (Part 1)
katiecoart
PRO
1
10k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
490
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
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ָʹͳΔ ·ͱΊ ج൫ΛੵΈ্͍͛ͯ͜͏