You can download a Mysql container with the 'flockport get' command.
flockport get mysql57
flockport get mariadb10
This gets you an unmanaged Mysql instance like any other container from the App store. To get a managed instance you need to use the 'adddb' command.
flockport adddb mariadb [server] [dbname] [dbusername]
This directly deploys a database instance to a provisioned server. The 'server' here refers to any server that has been provisioned with Flockport. 'Local' is used to refer to the local server. The dbname and dbusername refer to the database to create for this instance.
So for instance if you want to deploy a Mysql instance to a provisioned xenial server for Wordpress:
flockport adddb mariadb xenial wordpress wordpress
This will deploy a Mysql instance to the xenial server and create a wordpress database for user wordpress. The password is automatically generated and stored in the container
You can deploy a database container anywhere in the cluster and provide the IP of the Mysql instance for clients. You can also use the builtin service discovery layer to automate this step.
You can list any deployed databases with the flockport listdbs command.
This will list any database instances deployed with the adddb command clusterwide and also list any individual databases.
If you have service discovery enabled you can create a service for the Mysql instance and your applications will be able to find it via the service discovery layer. This will save the manual process of configuring the Mysql instance IP in your apps configuration.
The first time a Mysql instance is started a new password is generated. The same capablities are also available for Postgresql.
Currently only Mysql and Postgresql are supported by the adddb command.
We use use some of these capabilities with the Flockport container build system. When defining a container with a recipe you can use the keyword DB to automatically deploy a linked database for you application. You can also add more databases to any managed instance with the dbadd/dbdel command set. Similarly resetdb can be used to clear all databases and generate a fresh instance.
The same lifecycle management capabilities are available to deploy on demand web proxies - Nginx reverse proxies to serve your container apps - and load balancers with both Haproxy and Nginx. The service discovery layer too is provided by managed Consul. We will cover more of these capabilities in future posts.
Flockport is a new container orchestration platform focused on showcasing the ease and flexibility of containers. Flockport currently supports LXC containers.