.. _juju_install: ============================== Beta - Install Fleio with juju ============================== .. contents:: :local: Prerequisites ============= The beta Fleio installation currently works only on juju `microk8s` clusters. Follow instructions on the https://juju.is/docs/olm/microk8s page to set up juju with `microk8s` (follow the guide up until deploying a kubernetes charm). After installing and configuring `microk8s` and `juju`, you should have: - a controller - a cloud - a juju model (called `testing` in the Juju documentation) You also need to enable dns, storage and ingress addons on `microk8s`: .. code-block:: bash microk8s enable dns storage ingress On some edge clusters (microk8s, k0s, k3s, minikube ...) you may need to install `nfs-common` on the host machine. .. code-block:: bash apt install nfs-common Installing a database charm =========================== Fleio needs a mariadb database. On juju installation you will need to install a charm that provides a `mysql` relation and add a relation between that charm and fleio. We recommend using `charmed-osm-mariadb-k8s` charm - https://charmhub.io/charmed-osm-mariadb-k8s Install the charm using the following command .. code-block:: bash juju deploy charmed-osm-mariadb-k8s Installing Fleio with juju ========================== First you need to create a yaml file named `fleio-main-image.yaml` with the following contents (replace and ): .. code-block:: yaml registrypath: hub.fleio.com/fleio_main-2022-04:0 username: password: The next step is to download the charm, which is available at ``https://fleio.com/fleio-k8s_ubuntu-20.04-amd64.charm`` .. code-block:: bash wget https://fleio.com/fleio-k8s_ubuntu-20.04-amd64.charm Before moving to the final step, run ``microk8s status --wait-ready`` and check the following: * microk8s is running * dns, ingress and storage addons are enabled (here you might have a slight delay and you will need to wait for these to be enabled). If everything looks fine, run the following commands after replacing <> placeholders with correct values to deploy Fleio using juju: .. note:: The domain you are using should not have the ``http://`` or ``https://`` protocol (e.g. the --config domain= should be --config domain=fleio.com). If you have DNS configured and you want a letsencrypt SSL certificate issued on install, please check :ref:`issue-letsencrypt`. .. code-block:: bash juju deploy ./fleio-k8s_ubuntu-20.04-amd64.charm --resource fleio-main-image= \ --config releaseSuffix="-2022-04:0" \ --config registry=hub.fleio.com \ --config licenseUUID= \ --config licenseKey= \ --config registryUser= \ --config registryPass= \ --config admin_user= \ --config admin_pass= \ --config admin_email= \ --config admin_firstName= \ --config admin_lastName= \ --config domain= juju add relation fleio-k8s mariadb-k8s Executing juju actions ====================== You can retrieve a list of supported actions using the following command: .. code-block:: bash juju actions fleio-k8s You can execute an action using `juju run-action` command. Example .. code-block:: bash juju run-action fleio-k8s/leader install-status --wait .. _issue-letsencrypt: Enable letsencrypt SSL certificate ================================== You can have Fleio generate a letsencrypt SSL certificate directly on install by using the `tls_email` and `tls_enableLetsEncrypt` config options in the juju deploy command: .. code-block:: bash juju deploy ./fleio-k8s_ubuntu-20.04-amd64.charm --resource fleio-main-image= \ --config releaseSuffix="-2022-04:0" \ --config registry=hub.fleio.com \ --config licenseUUID= \ --config licenseKey= \ --config registryUser= \ --config registryPass= \ --config admin_user= \ --config admin_pass= \ --config admin_email= \ --config admin_firstName= \ --config admin_lastName= \ --config tls_email= \ --config tls_enableLetsEncrypt=yes \ --config domain= If you've already deployed Fleio with Juju, but without adding those config options then you can enable letsencrypt by accessing the fleio-utils container and run ``fleiok8s enable-letsencrypt`` command: .. code-block:: bash microk8s.kubectl exec -it deploy/fleio-utils -n testing -- bash fleiok8s enable-letsencrypt Known issues ============ While having multiple replicas for fleio-operations deployment, OpenStack resources (e.g. instances, volumes) that are created via operations sometimes might get duplicated.