Should I use k8s statefulsets directly or mysql-operator to deploy master-slave mysql cluster? Should I use k8s statefulsets directly or mysql-operator to deploy master-slave mysql cluster? kubernetes kubernetes

Should I use k8s statefulsets directly or mysql-operator to deploy master-slave mysql cluster?


Users can deploy and maintain a set of highly available MySQL services in k8s based on StatefulSets, the process is relatively complex. This process requires users to familiarize themselves with various k8s resource objects, learn many MySQL operation details and maintain a set of complex management scripts. Kubernetes Operators are designed to reduce the threshold for deploying complex applications on k8s.

Operator hides the orchestration details of complex applications and greatly reduces the threshold to use them in k8s. If you need to deploy other complex applications, we recommend that you use the Operator.

Speaking about master election while using StatefulSet.Electing potential slave to be a master is not an automatic process - you have to configure this manually using Xtrabackup - here is more information - setting_up_replication.

Take a look: cloning-existing-data, starting-replication, mysql-statefulset-operator.

Useful tools: vitess for better MySQL networking management and percona-xtradb-cluster that provides superior performance, scalability and instrumentation.