Running MySQL in Kubernetes / Openshift
1.Running MySQL in Kubernetes / Openshift Vadim Tkachenko, CTO, Percona
2. What is Kubernetes? Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation.
3. What is Kubernetes? (my version) Kubernetes is a way to “automagically” manage data center resources requested to run applications and tasks Kubernetes is an Operating System for multiple computing, networking, and storage resources
4.Why Kubernetes? ● Cloud Agnostic ○ Unified API ● A standard supported by multiple cloud and software vendors ● Based on modern container-based deployment
5.Massive support from the industry leaders ● OpenShift from RedHat ● Amazon Elastic Container Service for Kubernetes ● Google Kubernetes Engine ● Azure Kubernetes Service ● Pivotal Kubernetes Service ● Digital Ocean Kubernetes (Early Access) ● 35+ public distributions of Kubernetes on the market
6.Let’s look under the hood
9.Properties ● Container can be destroyed and restarted automatically ● POD can be destroyed and restarted on a different Node ● POD can be multiplied - scaling out ● Great for “stateless” application, e.g. web server ● No so great for databases ○ We want to keep our data
10.Databases as first class citizens ● Made possible with ○ Stateful Sets ○ Persistent Storage
12.MySQL In Kubernetes ● A single instance is easy ○ https://kubernetes.io/docs/tasks/run-application/run-single- instance-stateful-application/
13.A complex setup is … more complex ● High Availability ● Persistent Storage ● Backup and recovery ● Traffic routing ● Monitoring
15.Disclaimer ● The further information is based on our Proof Of Concept ● Use it as a guidance for your own setup, not as a production ready product ● https://github.com/Percona-Lab/percona-openshift
17.Replication Options ● Traditional MySQL replication ● Group Replication ● Percona XtraDB Cluster
18.Traditional Replication challenges ● No automatic failover ○ New master detection can be quite complicated ● No automatic slave setup
19.Group Replication ● Not mature enough ● Still no automatic slave setup
20.What is Percona XtraDB Cluster (PXC)?
21.Why PXC? Auto provisioning...
22.PXC: Data transfer
24.Storage options ● Local storage ○ Can be fast (SSD, NVMe options) ○ Still limited management capabilities in Kubernetes ● Network storage ○ Management and Flexibility if supported by your setup ■ Supported by major cloud providers ○ On-premise setup may require Ceph or SAN ○ The dynamic provision of persistent volumes is required
26.Traffic routing ● ProxySQL ○ High-performance MySQL proxy ○ Query Routing ○ Supports Failover
27.What is ProxySQL?
28.ProxySQL read/write split Query routing is one of the core features of ProxySQL. Read/write split is perhaps one of the most common query routing use
29.ProxySQL read-write split