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
810
『マネージド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.4k
mackerel-container-agentを用いたマルチテナントKubernetesのモニタリング
goto_hidenobu
1
9.4k
Other Decks in Technology
See All in Technology
Lexical Analysis
shigashiyama
1
150
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
410
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
600
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
Can We Measure Developer Productivity?
ewolff
1
150
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
The Role of Developer Relations in AI Product Success.
giftojabu1
1
130
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
110
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Designing for humans not robots
tammielis
250
25k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Documentation Writing (for coders)
carmenintech
65
4.4k
Building Your Own Lightsaber
phodgson
103
6.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Teambox: Starting and Learning
jrom
133
8.8k
What's new in Ruby 2.0
geeforr
343
31k
KATA
mclloyd
29
14k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
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͍͠
͋Γ͕ͱ͏͍͟͝·ͨ͠