SLIDE 1 Automating MySQL Deployments
Calin Don & Flavius Mecea Presslabs
SLIDE 2
Automating MySQL Deployments on Kubernetes
Percona Live 2018
SLIDE 3
Calin Don
Co-founder & CTO @Presslabs
Flavius Mecea
Project Lead @Presslabs Who are we? 00.
SLIDE 4
Context The Need Solution Use cases Outcomes Demo Project status Future plans 01. 02. 03. 04. 05. 06. 07. 08.
SLIDE 5
Context 01.
SLIDE 6 WordPress development agency
Context 01.
Managed WordPress hosting Record: 2,2 BN pageviews in a month Top tier in Enterprise hosting Open-Source Stack
2007 2011 2013 2015 2018
SLIDE 7 Context / Why Kubernetes? 01.
- Ubiquitous technology
- Open-source
- The core of our Stack
SLIDE 8
The Need 02.
SLIDE 9
1. Easy MySQL Cluster deployment in Kubernetes 2. Scalable MySQL Cluster* 3. High availability for MySQL 4. Automated backups & restore 5. Built-in monitoring The Need 02.
SLIDE 10
The Need 03. didn’t fit our scaling model didn’t provide enough automation
SLIDE 11
Solution 03.
SLIDE 12 Kubernetes Operator for managing MySQL Clusters with asynchronous or semi-synchronous replication.
- Self-healing clusters
- Highly available reads
- Virtually highly available writes
- Replication lag detection and mitigation
- Resource abuse control
- Automated backups and restores
Solution 03.
SLIDE 13 How it’s made
Solution 03.
SLIDE 14
Node internals Solution 03.
SLIDE 15 Percona is battle-tested in Enterprise environments. Solution 03.
- Percona XtraBackup
- Percona Toolkit
- Percona Server for MySQL
- Percona Monitoring & Management
NOW UPCOMING
SLIDE 16
Use Cases 04.
SLIDE 17
- Microservices
- Ephemeral databases for testing
- On-premise DBaaS
Use Cases 04.
SLIDE 18
Outcomes 05.
SLIDE 19
Outcomes / Evaluation setup 05.
~ $50 ~ $50
SLIDE 20 Target performance vs required resources
Outcomes / Evaluation setup 05.
QPS
SLIDE 21 Target performance vs required resources
Outcomes / Evaluation setup 05.
QPS
SLIDE 22 Target performance vs required resources
Outcomes / Evaluation setup 05.
QPS
SLIDE 23 Target performance vs required resources
Outcomes / Evaluation setup 05.
QPS
SLIDE 24 Target performance vs required resources
Outcomes / Evaluation setup 05.
QPS
SLIDE 25
~ $50 ~ $250
Outcomes / Costs 05.
SLIDE 26
Calin Don
SLIDE 27
Demo time! 06.
SLIDE 28
$ helm repo add presslabs https://presslabs.github.io/charts $ helm install presslabs/mysql-operator --name mysql-operator Demo - install MySQL Operator
SLIDE 29
$ helm repo add presslabs https://presslabs.github.io/charts $ helm install presslabs/mysql-operator --name mysql-operator NAME: mysql-operator LAST DEPLOYED: Fri Nov 2 12:09:24 2018 NAMESPACE: default STATUS: DEPLOYED ... Demo - install MySQL Operator
SLIDE 30 apiVersion: v1 kind: Secret metadata: name: test-secret type: Opaque data: ROOT_PASSWORD: bm90LXNvLXNlY3VyZQ== # USER: # PASSWORD: # DATABASE:
- apiVersion: mysql.presslabs.org/v1alpha1
kind: MysqlCluster metadata: name: test spec: replicas: 1 secretName: test-secret
cluster.yaml
Demo - create a cluster
SLIDE 31 $ kubectl apply -f cluster.yaml secret/test-secret created mysqlcluster.mysql.presslabs.org/test created $ kubectl get pods NAME READY STATUS RESTARTS AGE test-mysql-0 4/4 Running 2 4m
Demo - create a cluster
SLIDE 32 $ kubectl describe mysqlcluster test ... Status: Conditions: Status: True Type: Ready Ready Nodes: 1 Nodes: Name: test-mysql-0.test-mysql-nodes.default Conditions:
Status: Unknown
Replicating Status: False
Master Status: True
ReadOnly Status: False
Demo - create a cluster
SLIDE 33 $ kubectl port-forward svc/test-mysql-master 3306 & Forwarding from 127.0.0.1:3306 -> 3306 Forwarding from [::1]:3306 -> 3306 $ mysql --host=localhost -u app-user -papp-password If you don't see a command prompt, try pressing enter. mysql> SELECT @@hostname; +--------------+ | @@hostname | +--------------+ | test-mysql-0 | +--------------+ 1 row in set (0.01 sec)
Demo - connect to cluster
SLIDE 34 Demo - scale up
apiVersion: mysql.presslabs.org/v1alpha1 kind: MysqlCluster metadata: name: test spec: replicas: 2 secretName: test-secret
cluster.yaml
SLIDE 35
$ kubectl apply -f cluster.yaml mysqlcluster.mysql.presslabs.org/test updated Demo - scale up
SLIDE 36
Project status 07.
SLIDE 37 ~250 commits, ~60 closed PRs 2nd rewrite, version 0.2.0 - is almost complete
Project status 07. Community Contributors
SLIDE 38
Future Plans 08.
SLIDE 39
- Logical mysqldump backups
- Point in time backup and restore
- Integrate Percona Management & Monitoring
- Kubernetes Service Catalog integration
- ProxySQL integration
- Vault integration
- GUI
Future Plans 08.
SLIDE 40
Contribute! www.github.com/presslabs/mysql-operator