Deploying MySQL and MongoDB in Kubernetes
Alexander Rubin Percona
Deploying MySQL and MongoDB in Kubernetes Alexander Rubin Percona - - PowerPoint PPT Presentation
Deploying MySQL and MongoDB in Kubernetes Alexander Rubin Percona About me Working with MySQL for 10-15 years Started at MySQL AB, Sun Microsystems, Oracle (MySQL Consulting) Joined Percona in 2013 2 What is Kubernetes?
Alexander Rubin Percona
2
3
4
5
6
7
8
12
15
16
○ https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-appli cation/
17
18
20
21
22
23
24
25
27
○ Can be fast (SSD, NVMe options) ○ Still limited management capabilities in Kubernetes
○ 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
29
30
31
32
33
34
35
37
38
backup-volume.yaml mysql-configmap.yaml proxysql-pxc.yaml pxc.yaml secret.yaml xtrabackup-job.yaml
39
40
41
* image: RedHat OpenShift documentation
42
43
44
45
46
cluster1-proxysql-0 2/2 Running 0 cluster1-node-0 2/2 Running 0 cluster1-node-1 2/2 Running 0 cluster1-node-2 2/2 Running 0
47
cluster1-proxysql ClusterIP 10.11.251.66 <none> 3306/TCP,6032/TCP MySQL Port (for app) Proxy Admin Port
48
kubectl exec cluster1-proxysql-0 -it -- mysql -uadmin -padmin -h127.0.0.1 -P6032
mysql> select * from mysql_servers; +--------------+-----------+------+--------+---------+-------------+-----------------+----+---------+ | hostgroup_id | hostname | port | status | weight | compression | max_connections | .. | comment | +--------------+-----------+------+--------+---------+-------------+-----------------+----+---------+ | 10 | 10.8.2.10 | 3306 | ONLINE | 1000000 | 0 | 1000 | .. | WRITE | | 11 | 10.8.1.6 | 3306 | ONLINE | 1000 | 0 | 1000 | .. | READ | | 11 | 10.8.0.10 | 3306 | ONLINE | 1000 | 0 | 1000 | .. | READ | +--------------+-----------+------+--------+---------+-------------+-----------------+----+---------+
49
NAME READY STATUS RESTARTS AGE cluster1-node-0 0/2 Terminating 0 41m cluster1-node-1 2/2 Running 0 41m cluster1-node-2 2/2 Running 0 40m cluster1-proxysql-0 2/2 Running 0 41m monitoring-0 1/1 Running 0 35m
50
mysql> select * from mysql_servers; +--------------+-----------+------+--------------+---------+-------------+-----------------+---------+ | hostgroup_id | hostname | port | status | weight | compression | max_connections | comment | +--------------+-----------+------+--------------+---------+-------------+-----------------+---------+ | 11 | 10.8.2.10 | 3306 | OFFLINE_HARD | 1000 | 0 | 1000 | READ | | 11 | 10.8.1.6 | 3306 | ONLINE | 1000 | 0 | 1000 | READ | | 10 | 10.8.0.10 | 3306 | ONLINE | 1000000 | 0 | 1000 | WRITE | | 11 | 10.8.2.12 | 3306 | ONLINE | 1000 | 0 | 1000 | READ | +--------------+-----------+------+--------------+---------+-------------+-----------------+---------+
51
52
mysql> select * from mysql_servers; +--------------+-----------+------+--------------+---------+-------------+-----------------+---------+ | hostgroup_id | hostname | port | status | weight | compression | max_connections | comment | +--------------+-----------+------+--------------+---------+-------------+-----------------+---------+ | 11 | 10.8.2.10 | 3306 | OFFLINE_HARD | 1000 | 0 | 1000 | READ | | 11 | 10.8.1.6 | 3306 | ONLINE | 1000 | 0 | 1000 | READ | | 10 | 10.8.0.10 | 3306 | ONLINE | 1000000 | 0 | 1000 | WRITE | | 11 | 10.8.2.12 | 3306 | ONLINE | 1000 | 0 | 1000 | READ | | 11 | 10.8.1.7 | 3306 | ONLINE | 1000 | 0 | 1000 | READ | +--------------+-----------+------+--------------+---------+-------------+-----------------+---------+
53
54
○ At Rest ○ End-to-end
55
56
For the details see https://blog.openshift.com/getting-started-helm-openshift/
57
58
○ Great for deployment and testing
○ Implements read-write split
59
60