Migrating a Docker Fleio installation to Kubernetes¶
Warning
Fleio in Kubernetes is still in beta, and is not intended for production use.
License considerations¶
A Fleio license allows you to run Fleio on one machine. However, during the migration process, Fleio needs to run on two machines.
Before starting the migration process, you should contact us to update your license so it can temporarily be used on more than one machine.
Deploy Fleio on Kubernetes¶
First, you need to deploy Fleio in a Kubernetes cluster. See Beta - Installing Fleio in kubernetes using Fleio operator. If you contacted us to temporarily update your license, you should be able to use the same license as on your Docker installation.
We recommend using a public IP for the cluster and a real domain (subdomain name) so an SSL certificate can be automatically acquired.
Stop old Docker Fleio installation & backup database¶
Warning
Once the old Fleio installation has been stopped you should not start it again to avoid conflicts.
Once you have a working Fleio in Kubernetes, it’s time to stop your old Fleio installation. Use the following command to stop Fleio:
fleio stop
And then use the following command to create a backup of the database:
fleio backup now
A new backup should be present in /home/fleio/backups folder.
Copy database¶
Now you should create a new database in your MariaDB server used in your Kubernetes deployment and populate it using the backup created at the previous step.
Once the backup is restored, you need to create a FleioDbConnection custom resource in Kubernetes and wait for the Fleio operator to validate it. You can query resource status using the following command:
kubectl get fleiodbconnection
Copy secret keys¶
Next, you will need the secret keys from your Fleio Docker installation to be able to access encrypted data in DB.
Run the following command on your Fleio Docker installation to open a Fleio shell:
fleio bash
And then use the following commands to retrieve SECRET_KEY
and SSO_SALT
:
cat fleio/fleiosettings/settings.py | grep SSO_SALT
cat fleio/fleiosettings/settings.py | grep SECRET_KEY
Once you have retrieved the keys, update the deployment-keys secret in your Fleio Kubernetes deployment (see fleio-<fleioDeployment>-deployment-keys).
Update Fleio Kubernetes deployment¶
After all the above steps have been completed, you can edit your FleioDeployment custom resource and set the new FleioDbConnection name (see FleioDeployment).
After you update the resource, the Fleio Kubernetes operator will detect the change and switch Fleio to the new database.