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.2k
Other Decks in Technology
See All in Technology
君は隠しイベントを見つけれるか?
mujyun
0
270
omakaseしないための.rubocop.yml のつくりかた / How to Build Your .rubocop.yml to Avoid Omakase #kaigionrails
linkers_tech
3
710
いまならこう作りたい AWSコンテナ[本格]入門ハンズオン 〜2024年版 ハンズオンの構想〜
horsewin
9
2k
とあるユーザー企業におけるリスクベースで考えるセキュリティ業務のお話し
4su_para
3
320
日経電子版におけるリアルタイムレコメンドシステム開発の事例紹介/nikkei-realtime-recommender-system
yng87
1
480
20241031_AWS_生成AIハッカソン_GenMuck
tsumita
0
110
Emacs x Nostr
hakkadaikon
1
150
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
24
6.7k
オニオンアーキテクチャで実現した 本質課題を解決する インフラ移行の実例
hryushm
14
3k
[AWS JAPAN 生成AIハッカソン] Dialog の紹介
yoshimi0227
0
140
グローバル展開を見据えたサービスにおける機械翻訳プラクティス / dp-ai-translating
cyberagentdevelopers
PRO
1
150
新R25、乃木坂46 Mobileなどのファンビジネスを支えるマルチテナンシーなプラットフォームの全体像 / cam-multi-cloud
cyberagentdevelopers
PRO
1
130
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Navigating Team Friction
lara
183
14k
Producing Creativity
orderedlist
PRO
341
39k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
We Have a Design System, Now What?
morganepeng
50
7.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
13
1.9k
Into the Great Unknown - MozCon
thekraken
31
1.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
GraphQLとの向き合い方2022年版
quramy
43
13k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
What's new in Ruby 2.0
geeforr
342
31k
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͍͠
͋Γ͕ͱ͏͍͟͝·ͨ͠