Automating MySQL Deployments on Kubernetes Calin Don & Flavius - - PowerPoint PPT Presentation

automating mysql deployments on kubernetes
SMART_READER_LITE
LIVE PREVIEW

Automating MySQL Deployments on Kubernetes Calin Don & Flavius - - PowerPoint PPT Presentation

Automating MySQL Deployments on Kubernetes Calin Don & Flavius Mecea Presslabs Automating MySQL Deployments on Kubernetes Percona Live 2018 00. Who are we? Calin Don Flavius Mecea Co-founder & CTO Project Lead @Presslabs


slide-1
SLIDE 1

Automating MySQL Deployments

  • n Kubernetes

Calin Don & Flavius Mecea Presslabs

slide-2
SLIDE 2

Automating MySQL Deployments on Kubernetes

Percona Live 2018

slide-3
SLIDE 3

Calin Don

Co-founder & CTO @Presslabs

Flavius Mecea

Project Lead @Presslabs Who are we? 00.

slide-4
SLIDE 4

Context The Need Solution Use cases Outcomes Demo Project status Future plans 01. 02. 03. 04. 05. 06. 07. 08.

slide-5
SLIDE 5

Context 01.

slide-6
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
SLIDE 7

Context / Why Kubernetes? 01.

  • Ubiquitous technology
  • Open-source
  • The core of our Stack
slide-8
SLIDE 8

The Need 02.

slide-9
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
SLIDE 10

The Need 03. didn’t fit our scaling model didn’t provide enough automation

slide-11
SLIDE 11

Solution 03.

slide-12
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
SLIDE 13

How it’s made

Solution 03.

slide-14
SLIDE 14

Node internals Solution 03.

slide-15
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
SLIDE 16

Use Cases 04.

slide-17
SLIDE 17
  • Microservices
  • Ephemeral databases for testing
  • On-premise DBaaS

Use Cases 04.

slide-18
SLIDE 18

Outcomes 05.

slide-19
SLIDE 19

Outcomes / Evaluation setup 05.

~ $50 ~ $50

slide-20
SLIDE 20

Target performance vs required resources

Outcomes / Evaluation setup 05.

QPS

slide-21
SLIDE 21

Target performance vs required resources

Outcomes / Evaluation setup 05.

QPS

slide-22
SLIDE 22

Target performance vs required resources

Outcomes / Evaluation setup 05.

QPS

slide-23
SLIDE 23

Target performance vs required resources

Outcomes / Evaluation setup 05.

QPS

slide-24
SLIDE 24

Target performance vs required resources

Outcomes / Evaluation setup 05.

QPS

slide-25
SLIDE 25

~ $50 ~ $250

Outcomes / Costs 05.

slide-26
SLIDE 26

Calin Don

slide-27
SLIDE 27

Demo time! 06.

slide-28
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
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
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
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
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:

  • Type: Lagged

Status: Unknown

  • Type:

Replicating Status: False

  • Type:

Master Status: True

  • Type:

ReadOnly Status: False

Demo - create a cluster

slide-33
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
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
SLIDE 35

$ kubectl apply -f cluster.yaml mysqlcluster.mysql.presslabs.org/test updated Demo - scale up

slide-36
SLIDE 36

Project status 07.

slide-37
SLIDE 37

~250 commits, ~60 closed PRs 2nd rewrite, version 0.2.0 - is almost complete

Project status 07. Community Contributors

slide-38
SLIDE 38

Future Plans 08.

slide-39
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
SLIDE 40

Contribute! www.github.com/presslabs/mysql-operator