The MySQL Operator for Kubernetes is an operator for managing MySQL Cluster
https://github.com/RimXu/mysql-operator.git
1.安装kubebuilder:https://kubebuilder.io/
2.从github获取源码
# git clone https://github.com/RimXu/mysql-operator.git
# cd mysql-operator/
3.初始化operator:
# mkdir -p /code/go/operator/mysql-operator
# cd /code/go/operator/mysql-operator
# go mod init mysql-operator
# kubebuilder init --domain operator.io
# kubebuilder create api --group database --version v1 --kind Mysql
4.创建API:
# kubebuilder create api --group database --version v1 --kind Mysql
5.编译和安装,使用make编译,make install部署CRD:
# make && make install
6.启动controller
# make run
7.制作MySQL-operator镜像:
# docker build . -t mysql-operator:0.1
示例