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
『マネージドMySQL提供に向けた挑戦』@ CIU Tech Meetup#1
Search
hidenobu goto
June 07, 2023
Technology
3
820
『マネージドMySQL提供に向けた挑戦』@ CIU Tech Meetup#1
hidenobu goto
June 07, 2023
Tweet
Share
More Decks by hidenobu goto
See All by hidenobu goto
CloudNativeDaysTokyo 2019 slide
goto_hidenobu
2
2.5k
mackerel-container-agentを用いたマルチテナントKubernetesのモニタリング
goto_hidenobu
1
9.6k
Other Decks in Technology
See All in Technology
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
450
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
460
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.3k
UI State設計とテスト方針
rmakiyama
2
580
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
740
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
3
260
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
なぜCodeceptJSを選んだか
goataka
0
160
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.3k
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
For a Future-Friendly Web
brad_frost
175
9.4k
Side Projects
sachag
452
42k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Practical Orchestrator
shlominoach
186
10k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Optimising Largest Contentful Paint
csswizardry
33
3k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
RailsConf 2023
tenderlove
29
940
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Transcript
ϚωʔδυMySQLఏڙʹ͚ͨઓ גࣜձࣾαΠόʔΤʔδΣϯτ CIU Development Div ޙ౻ल৴ CIU Tech Meetup #1
@2023/06/07
ޙ౻ल৴ • גࣜձࣾαΠόʔΤʔδΣϯτ ɹɹɹάϧʔϓITਪਐຊ෦ CIU Development Div • 20169݄
த్ೖࣾ (લ৬SIer) • ϓϥΠϕʔτΫϥυͷίϯϙʔωϯτ։ൃ • Go, Kubernetes, Linux, Python, DB
1.։ൃͷഎܠ 2.։ൃͷํ 3.ར༻ٕज़ͱΞʔΩςΫνϟ 4.ಈ࡞֓ཁͷઆ໌ 5.·ͱΊ
։ൃͷํ
։ൃͷํ • ίϚϯυൃͰDBߏஙɺࣗಈνϡʔχϯά • F/Oඞਢɺ෮چޙࣗಈΈࠐΈ • MySQLͷఏڙ • ֤ϝτϦΫεɺϩάɺόοΫΞοϓ •
Ϣʔβཧ
։ൃͷํ • k8sͷOperatorΛ׆༻Ͱ͖Δ͔? ɹɹ👍 એݴతAPIͰཧͰ͖Δ ɹɹ👍 ։ൃ͕ΜͰجຊతʹ҆ఆ͍ͯ͠Δ ɹɹ👍 F/Oʹ͍ͭͯͳ͘ߦ͏͜ͱ͕Ͱ͖Δ
։ൃͷํ • k8sͷOperatorΛ׆༻Ͱ͖Δ͔? ɹɹ🌪 kubernetesʹԿ͔͋ͬͨ࣌ͷಈ࡞୲อ ɹɹ🌪 ݖݶཧͷෑډ (جຊVMͷΞΫηεෆՄ) ɹɹ🌪
Platformతʹखಈઃఆ͕ඞཁͳՕॴ͕͋Δ
։ൃͷํ • MySQLؔ࿈ͷπʔϧΛ׆༻Ͱ͖Δ͔? ɹɹ👍 ཧπʔϧͷOrchestratorݟ͕ଟ͍ ɹɹ👍 ϝτϦΫεऔಘͰ͖ΔOSS͋Δ
։ൃͷํ • MySQLؔ࿈ͷπʔϧΛ׆༻Ͱ͖Δ͔? ɹɹ🌪 MySQL5ܥରԠ͕ඞཁͳͨΊπʔϧ͕ݶఆత ɹɹ🌪 ӡ༻ਓ͕গͳ͍ͨΊɺࣗಈ෮چ͍ͤͨ͞
طଘOperatorɺπʔϧ͚ͩͰݫ͍͠ ɹ͍͑͑ɺ࡞ͬͯ͠·͑ɹ
։ൃͷํ • ເΛ٧ΊࠐΜͰΈΔ • DBVMͱͯ͠ಈ࡞ͤ͞Δ • એݴతAPIੵۃతʹ͍͖͍ͬͯͨ • 5ܥ8ܥԣஅɺڞ௨ཧ͕Ͱ͖Δ •
Կ͔͋ͬͯجຊతʹࣗಈ෮چ
CDB (Cycloud Database) ͦͷ໊
ར༻ٕज़ͱ ΞʔΩςΫνϟ
ར༻ٕज़ • Kubernetes ཧίϯϙʔωϯτσϓϩΠɹ • Custom Resource / Controllerɹɹ
CDBϦιʔεͱͯ͠ఆٛ • MySQL Orchestrator MySQLͷF/Oʹར༻ • OpenStack DBΠϯελϯεͷ࡞ • Terraform ίϯτϩʔϥʔͰ࣮ߦ
ར༻ٕज़ • Kubernetes ཧίϯϙʔωϯτσϓϩΠɹ • Custom Resource / Controllerɹɹ
CDBϦιʔεͱͯ͠ఆٛ • MySQL Orchestrator MySQLͷF/Oʹར༻ • OpenStack DBΠϯελϯεͷ࡞ • Terraform ίϯτϩʔϥʔͰ࣮ߦ
Custom Resource / Controller • Custom Resource •Kubernetes APIͷ֦ு •ಛఆͷAPIΦϒδΣΫτͷίϨΫγϣϯΛอ࣋
• Custom Controller •ϦιʔεΛ͋Δ͖ঢ়ଶʹಉظ͠ཧ • Custom ResourceͱΈ߹ΘͤͯCDBͷػೳΛఏڙ https://github.com/kubernetes-sigs/kubebuilder
ར༻ٕज़ • Kubernetes ཧίϯϙʔωϯτσϓϩΠɹ • Custom Resource / Controllerɹɹ
CDBϦιʔεͱͯ͠ఆٛ • MySQL Orchestrator MySQLͷF/Oʹར༻ • OpenStack DBΠϯελϯεͷ࡞ • Terraform ίϯτϩʔϥʔͰ࣮ߦ
MySQL Orchestrator • MySQLͷϨϓϦέʔγϣϯঢ়ଶͷཧ • F/OͷڍಈΛࡉ͔͘ϋϯυϦϯάͰ͖Δ • ίϯϙʔωϯτࣗମRaftΛͬͯԽ • API๛ʹ༻ҙ͞Ε͍ͯΔ
https://github.com/openark/orchestrator
MySQL Orchestrator • MySQLͷϨϓϦέʔγϣϯঢ়ଶͷཧ • F/OͷڍಈΛࡉ͔͘ϋϯυϦϯάͰ͖Δ • ίϯϙʔωϯτࣗମRaftΛͬͯԽ • API๛ʹ༻ҙ͞Ε͍ͯΔ
https://github.com/openark/orchestrator
ར༻ٕज़ • Kubernetes ཧίϯϙʔωϯτσϓϩΠɹ • Custom Resource / Controllerɹɹ
CDBϦιʔεͱͯ͠ఆٛ • MySQL Orchestrator MySQLͷF/Oʹར༻ • OpenStack DBΠϯελϯεͷ࡞ • Terraform ίϯτϩʔϥʔͰ࣮ߦ
OpenStack • Cycloud ͷ IaaSج൫ • όʔδϣϯ Queensʹ৭ʑͱύονద༻ • VM
/ ϘϦϡʔϜͷ࡞আΞλον/ σλονૢ࡞ • αʔϏεଆͷΤϯδχΞIaaSͱ͍ͯͬͯ͠Δج൫ https://github.com/openstack
ར༻ٕज़ • Kubernetes ཧίϯϙʔωϯτσϓϩΠɹ • Custom Resource / Controllerɹɹ
CDBϦιʔεͱͯ͠ఆٛ • MySQL Orchestrator MySQLͷF/Oʹར༻ • OpenStack DBΠϯελϯεͷ࡞ • Terraform ίϯτϩʔϥʔͰ࣮ߦ
Terraform • IaCͷπʔϧͷ1ͭ • એݴతʹϦιʔεΛཧ • hclͱ͍͏ݴޠͰهड़͢Δ • ֤ΫϥυͷϓϩόΠμʔ͕༻ҙ͞Ε͍ͯΔ https://github.com/hashicorp/terraform
https://github.com/isaaguilar/terraform-operator
͜ͷลΓΛྑ͖͔ͳΈ߹Θͤͯ CDBಈ͍ͯ·͢
࡞࣌ίϚϯυ
࡞࣌ίϚϯυ
࡞࣌ίϚϯυ DNSϨίʔυΛDBͷ ΤϯυϙΠϯτͱͯ͠ར༻
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller܈ gRPC ೝূ
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller܈ gRPC ೝূ
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller܈ gRPC ೝূ
࡞ϑϩʔ gateway mysql controller instance controller setting controller܈ gRPC ೝূ
apiVersion: cdb.cycloud.io/v1 kind: MysqlCon fi g metadata: name: xxxxxxxxx namespace: xxxxxxxxx spec: connect_timeout: 100 engine_version: 8 expire_log_days: 10
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller܈ gRPC ೝূ
apiVersion: v1 kind: Con fi gMap metadata: name: xxxxxxxxx namespace: xxxxxxxxx data: connect_timeout: "100" expire_log_days: "10"
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller gRPC ೝূ
apiVersion: cdb.cycloud.io/v1 kind: MySQL metadata: name: xxxxxxxxx namespace: xxxxxxxx spec: fl avor: large replica: 1 storage: kind: xxxxxxxx size_gib: 45
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller gRPC ೝূ
apiVersion: cdb.cycloud.io/v1 kind: Instance metadata: name: xxxxxxxxx namespace: xxxxxxxx spec: dataVolume: size: 45 volumeType: xxxxx version: 8.0.28 fl avor: xxxxxxxxxx ༷ʑͳIaaSج൫ʹ ରԠͰ͖ΔΑ͏ʹநԽ
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller܈ gRPC ೝূ
OpenStack API
࡞ϑϩʔ gateway mysql controller܈ instance controller setting controller܈ gRPC ೝূ
OpenStack API DBࣗମVMͱͯ͠ OpenStack্ʹߏங
CDBͷΧελϜϦιʔεʢΫϥελܥʣ • MySQL • DBΫϥελϦϯάͷͨΊͷϝΠϯϦιʔε • Instance • ΠϯελϯεߏஙͷͨΊͷϦιʔε •
Connector • F/OΛ୲͢ΔϦιʔε • Orchestrator • MySQL OrchestratorΛཧ͢ΔϦιʔε
CDBͷΧελϜϦιʔεʢઃఆܥʣ • LoggingConfig • MySQLͷϩάؔ࿈ͷอଘઃఆ • LoginRootUser • RootϢʔβͷઃఆ •
MetricsConfig • ϝτϦΫεؔ࿈ͷઃఆ • MysqlBackup / MysqlSnapshot • σʔλͷόοΫΞοϓܥͷઃఆ • MysqlConfig • MySQLͷઃఆؔ
apiVersion: cdb.cycloud.io/v1 kind: MySQL metadata: name: xxxxxxxxx namespace: xxxxxxxx spec:
fl avor: large replica: 1 storage: kind: xxxxxxxx size_gib: 45 VMىಈޙ Mysqllet Mysqllet ओͳΓͱΓ ɹDBઃఆใͷऔಘ ɹϓϩδΣΫτใͷऔಘ ɹϓϥΠϚϦɺηΧϯμϦใͷऔಘ ɹߏஙঢ়گͷใࠂ DNSaaS
apiVersion: cdb.cycloud.io/v1 kind: MySQL metadata: name: xxxxxxxxx namespace: xxxxxxxx spec:
fl avor: large replica: 1 storage: kind: xxxxxxxx size_gib: 45 VMىಈޙ Mysqllet Mysqllet DNSaaS ɹConnectorϦιʔεΛར༻ ɹϓϥΠϚϦɺηΧϯμϦΛө
apiVersion: cdb.cycloud.io/v1 kind: MySQL metadata: name: xxxxxxxxx namespace: xxxxxxxx spec:
fl avor: large replica: 1 storage: kind: xxxxxxxx size_gib: 45 VMىಈޙ Mysqllet Mysqllet DNSaaS
༷ʑͳCustom Resourceɺ Custome ControllerΛར༻ͯ͠DBΛߏங
F/O࣌ͷಈ࡞ ϔϧενΣοΫ
F/O࣌ͷಈ࡞ ϔϧενΣοΫ
F/O࣌ͷಈ࡞ ϔϧενΣοΫ apiVersion: cdb.cycloud.io/v1 kind: Connector metadata: name: xxxxxxxxx namespace:
xxxxxxxx spec: owner: meetup rw: dummy.record.hoge.io rw_ip: XXX.XXX.XXX.XXX mysql controller
F/O࣌ͷಈ࡞ ϔϧενΣοΫ apiVersion: cdb.cycloud.io/v1 kind: Connector metadata: name: xxxxxxxxx namespace:
xxxxxxxx spec: owner: meetup rw: dummy.record.hoge.io rw_ip: XXX.XXX.XXX.XXX mysql controller DNSaaS
༷ʑͳCustom Resourceɺ Custom ControllerΛར༻ͯ͠DBͷՄ༻ੑΛ୲อ
·ͱΊ • νϡʔχϯάࣗಈͰ͓͢͢ΊઃఆʹͳΔ • DBΤϯδχΞͱڠྗͯ͠ͷܾఆ • ΦϯϥΠϯͰΈͷʹमਖ਼Մೳ • ֤छϝτϦΫεʹରԠ
·ͱΊ • ϚωʔδυMySQLͰ͋ΔCDBͷհ • MySQLΛίϯςφ → VM • DNSͷΓସ͑ͰF/OΛ࣮ݱ •
Kubernetes͕མͪͯ + DBམͪͳ͍ͱӨڹͳ͠ • MySQL͍͠
͋Γ͕ͱ͏͍͟͝·ͨ͠