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
強いチームと開発生産性
onk
PRO
35
11k
Taming you application's environments
salaboy
0
190
組織成長を加速させるオンボーディングの取り組み
sudoakiy
2
210
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
230
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
440
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
150
The Rise of LLMOps
asei
7
1.7k
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
Lexical Analysis
shigashiyama
1
150
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
110
Featured
See All Featured
Thoughts on Productivity
jonyablonski
67
4.3k
Into the Great Unknown - MozCon
thekraken
32
1.5k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
RailsConf 2023
tenderlove
29
900
Optimizing for Happiness
mojombo
376
70k
Scaling GitHub
holman
458
140k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
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͍͠
͋Γ͕ͱ͏͍͟͝·ͨ͠