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
コンテナセキュリティのためのLandlock入門
nullpo_head
2
330
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
200
podman_update_2024-12
orimanabu
1
290
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
280
[Oracle TechNight#85] Oracle Autonomous Databaseを使ったAI活用入門
oracle4engineer
PRO
1
130
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
160
Storage Browser for Amazon S3
miu_crescent
1
300
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
500
React Routerで実現する型安全なSPAルーティング
sansantech
PRO
2
280
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
120
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
39
16k
LINEスキマニにおけるフロントエンド開発
lycorptech_jp
PRO
0
340
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
For a Future-Friendly Web
brad_frost
175
9.4k
Optimising Largest Contentful Paint
csswizardry
33
3k
The Pragmatic Product Professional
lauravandoore
32
6.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
A Tale of Four Properties
chriscoyier
157
23k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
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͍͠
͋Γ͕ͱ͏͍͟͝·ͨ͠