This is a MariaDB Operator, which makes management of MariaDB instances (or clusters) running inside Kuberenetes clusters easy. It was built with the Operator SDK using Ansible.
The aim of this project is help to close this issue.
Creating the operator:
operator-sdk init --plugins=ansible --domain operator
operator-sdk create api --group mariadb --version v1 --kind MariaDB --generate-roleTo connect to the mariadb Database run:
POD=`kubectl get pods -n mariadb-operator -l app=mariadb | grep Running | grep 1/1 | awk '{print $1}'`
kubectl exec -n mariadb-operator -it $POD -- mysql -uroot -ppasswordBuild the operator
make docker-build docker-push IMG=imjoseangel/mariadb-operator:v1.0.0Deploy de operator
make install
make deploy IMG=imjoseangel/mariadb-operator:v1.0.0Verify status:
kubectl get deployment -n mariadb-operator-system
NAME READY UP-TO-DATE AVAILABLE AGE
mariadb-operator-controller-manager 1/1 1 1 8sView the Ansible Logs:
kubectl logs deployment/mariadb-operator-controller-manager -n mariadb-operator-system manager -fDeploy MariaDB
kubectl apply -f config/samples/mariadb_v1_mariadb.yaml