MySQL operator on Kubernetes using GTID-based semi-synchronous replication.
See the codeMOCO is a MySQL operator on Kubernetes. Its primary function is to manage MySQL clusters using GTID-based semi-synchronous replication. It does not manage group replication clusters.
MOCO is designed to have the following properties.
Blog article: Introducing MOCO, a modern MySQL operator on Kubernetes
If you use Kubernetes 1.35, using v1.35.4+ or disabling the MaxUnavailableStatefulSet feature gate is required (kubernetes/kubernetes#137409).
MOCO supports (tests) the LTS releases of MySQL 8. Innovation releases would probably work. But they are not tested in our CI.
kubectl pluginmysqld metricsmy.cnf configurationsYou can quickly run MOCO using kind.
e2e directory.make startYou can then create a three-instance MySQL cluster as follows:
$ cat > mycluster.yaml <<'EOF'
apiVersion: moco.cybozu.com/v1beta2
kind: MySQLCluster
metadata:
namespace: default
name: test
spec:
replicas: 3
podTemplate:
spec:
containers:
- name: mysqld
image: ghcr.io/cybozu-go/moco/mysql:8.4.10
volumeClaimTemplates:
- metadata:
name: mysql-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
EOF
$ export KUBECONFIG=$(pwd)/.kubeconfig
$ ../bin/kubectl apply -f mycluster.yaml
Check the status of MySQLCluster until it becomes healthy as follows:
$ ../bin/kubectl get mysqlcluster test
NAME AVAILABLE HEALTHY PRIMARY SYNCED REPLICAS ERRANT REPLICAS
test True True 0 3
Once it becomes healthy, you can use kubectl-moco to play with mysql client.
$ ../bin/kubectl moco mysql -it test
To destroy the Kubernetes cluster, run:
$ make stop
See https://cybozu-go.github.io/moco/
examples directory contains example MySQLCluster manifests.
We require all commits to comply with the Developer Certificate of Origin. Use git commit -s (or configure your Git client to add a Signed-off-by trailer) to sign off every commit before opening a pull request. Pull requests without the trailer will not pass our checks.
Docker images are available on ghcr.io/cybozu-go/moco.
Overall
Maintained
Code review
Go module
Latest release
Releases this year
134 followers · starred Apr 2025
57 followers · starred Jul 2021
222 followers · starred May 2020
60 followers · starred Apr 2024
MySQL operator on Kubernetes using GTID-based semi-synchronous replication.
See the codeMOCO is a MySQL operator on Kubernetes. Its primary function is to manage MySQL clusters using GTID-based semi-synchronous replication. It does not manage group replication clusters.
MOCO is designed to have the following properties.
Blog article: Introducing MOCO, a modern MySQL operator on Kubernetes
If you use Kubernetes 1.35, using v1.35.4+ or disabling the MaxUnavailableStatefulSet feature gate is required (kubernetes/kubernetes#137409).
MOCO supports (tests) the LTS releases of MySQL 8. Innovation releases would probably work. But they are not tested in our CI.
kubectl pluginmysqld metricsmy.cnf configurationsYou can quickly run MOCO using kind.
e2e directory.make startYou can then create a three-instance MySQL cluster as follows:
$ cat > mycluster.yaml <<'EOF'
apiVersion: moco.cybozu.com/v1beta2
kind: MySQLCluster
metadata:
namespace: default
name: test
spec:
replicas: 3
podTemplate:
spec:
containers:
- name: mysqld
image: ghcr.io/cybozu-go/moco/mysql:8.4.10
volumeClaimTemplates:
- metadata:
name: mysql-data
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
EOF
$ export KUBECONFIG=$(pwd)/.kubeconfig
$ ../bin/kubectl apply -f mycluster.yaml
Check the status of MySQLCluster until it becomes healthy as follows:
$ ../bin/kubectl get mysqlcluster test
NAME AVAILABLE HEALTHY PRIMARY SYNCED REPLICAS ERRANT REPLICAS
test True True 0 3
Once it becomes healthy, you can use kubectl-moco to play with mysql client.
$ ../bin/kubectl moco mysql -it test
To destroy the Kubernetes cluster, run:
$ make stop
See https://cybozu-go.github.io/moco/
examples directory contains example MySQLCluster manifests.
We require all commits to comply with the Developer Certificate of Origin. Use git commit -s (or configure your Git client to add a Signed-off-by trailer) to sign off every commit before opening a pull request. Pull requests without the trailer will not pass our checks.
Docker images are available on ghcr.io/cybozu-go/moco.
Overall
Maintained
Code review
Go module
Latest release
Releases this year
134 followers · starred Apr 2025
57 followers · starred Jul 2021
222 followers · starred May 2020
60 followers · starred Apr 2024