This operator is based on shell-operator. Goal of this operator is easily setup databases and users by using declaritive yaml configuration files.
helm install mariadb deploy/mariadb
The development environment installs k0s on vagrant and exports a kubeconfig file so that access to the kubernetes cluster from host machine is possible.
Please check the Makefile
for further details.
- vagrant
- vagrant-libvirt plugin
- vagrant-sshfs plugin
- Modify your Vagrantfile so that it fits to your need (e.x. cpu, memory)
- Kickoff a virtual machine with
vagrant up
- Set environment variable for
kubectl
withexport KUBECONFIG=kubeconf.conf
Either run vagrant ssh -- make -C /vagrant build test-latest
to get a container without dev-tools running or follow the next section to access the dev container.
- Build dev container by running
make -C hack build deploy
. - Insert on top of
~/.ssh/config
the following lineInclude path-to-your-repo/hack/ssh_config
. - Sync with rsync
make -C hack rsync-push
ormake -C hack rsync-pull
. - Open vs code via ssh
make -C hack open-vscode
- Run operator manually
kubectl exec -ti deployments/mariadb -- bash -c '/shell-operator 2>&1 | jq -r .msg'
kubectl exec -ti deployments/mariadb -- bash -c 'mysql -h 127.0.0.1 -u root --password=$MARIADB_ROOT_PASSWORD -e "SELECT Host, User, Password FROM mysql.user;"'
kubectl exec -ti deployments/mariadb -- bash -c 'mysql -h 127.0.0.1 -u root --password=$MARIADB_ROOT_PASSWORD -e "SHOW DATABASES"'
Enjoy!