Alpha - Installing Fleio in kubernetes using Fleio operator

Warning

This is an alpha release, it is considered unstable and is not intended for production enviroments.

Important notes

  • This was only tested with MicroK8s cluster, so this documentation will contain instructions on how to install Fleio on a MicroK8s kubernetes cluster

  • Only “Fleio OpenStack + Hosting Billing Edition” is supported at the moment

  • SSL is not supported at the moment

  • Upgrade is not supported at the moment

Preparing the environment

Note

The following commands work on Ubuntu 24.04, if you plan to use other distribution, you will have to run commands specific to your distribution.

Install microk8s, helm and kubectl:

sudo snap install microk8s --classic
sudo snap install helm --classic
sudo snap install kubectl --classic

The root CA certificate generated by MicroK8s does not include key usage extension needed by Fleio operator for authentication (click here for more details). Execute the following commands to generate a certificate with key usage extension.

mkdir cadir
openssl genrsa -out cadir/ca.key 2048
openssl req -x509 -new -nodes -key cadir/ca.key -sha256 -days 360 -out cadir/ca.crt -addext "keyUsage=critical,digitalSignature,keyCertSign"
sudo microk8s.refresh-certs cadir
rm -Rf cadir
sudo microk8s stop && sudo microk8s start
microk8s status --wait-ready

Run the following commands to enable some MicroK8s extension needed by Fleio and update kubectl config file:

microk8s enable dashboard hostpath-storage registry ingress cert-manager
microk8s status --wait-ready

Configure kubectl to connect to MicroK8s:

sudo usermod -a -G microk8s $USER
newgrp microk8s
mkdir ~/.kube
microk8s config > ~/.kube/config
chmod 600 ~/.kube/config

Test that kubectl works:

kubectl get all

Deploying Fleio in kubernetes using Fleio operator

Install Fleio operator

Fleio operator can be installed via helm. Add fleio helm repository:

helm repo add fleio "https://fleio.com/helm"
helm repo update fleio

Create values file for Fleio operator (replace <license-UUID> and <license-key> with your Fleio license):

cat <<EOT > fleio-operator-values.yaml
fleio:
  licenseUUID: "<license-UUID>"
  licenseKey: "<license-KEY>"
EOT

Install Fleio operator:

helm install fleio-operator fleio/fleio-operator -f fleio-operator-values.yaml

Create connections resources

Fleio needs a redis server and a mariadb database. Fleio operator adds two custom resource definitions (fleiodbconnection and fleioredisconnection) to configure these.

Create a fleiodbconnection and credentials secret

Before proceeding you need to install a mariadb server and create a database for Fleio with utf8mb4 character set and utf8mb4_unicode_ci collation.

Create a kubenetes.io/basic-auth secret with mariadb credentials (replace and with your credentials):

cat <<EOT > fleio-mariadb-credentials.yaml
apiVersion: v1
kind: Secret
metadata:
  name: fleio-mariadb-credentials
type: kubernetes.io/basic-auth
stringData:
  username: "<username>"
  password: "<password>"
EOT

Create a fleiodbconnection resource (replace and with your values):

cat <<EOT > fleio-mariadb-connection.yaml
apiVersion: "stable.fleio.com/v1"
kind: FleioDbConnection
metadata:
  name: fleio-db-connection
spec:
  hostname: "<hostname>"
  port: 3306
  credentialsSecret: fleio-mariadb-credentials
  databaseName: "<databaseName>"
EOT

Apply resources using kubectl:

kubectl apply -f fleio-mariadb-credentials.yaml
kubectl apply -f fleio-mariadb-connection.yaml

Create a fleioredisconnection and credentials secret

Before proceeding you need to install a redis server.

Create a kubenetes.io/basic-auth secret with redis credentials (replace and with your credentials, leave empty if your redis server accepts only password):

cat <<EOT > fleio-redis-credentials.yaml
apiVersion: v1
kind: Secret
metadata:
  name: fleio-redis-credentials
type: kubernetes.io/basic-auth
stringData:
  username: "<username>"
  password: "<password>"
EOT

Create a fleioredisconnection resource (replace your value):

cat <<EOT > fleio-redis-connection.yaml
apiVersion: "stable.fleio.com/v1"
kind: FleioRedisConnection
metadata:
  name: fleio-redis-connection
spec:
  hostname: "<hostname>"
  port: 6379
  credentialsSecret: fleio-redis-credentials
  databaseId: "0"
EOT

Apply resources using kubectl:

kubectl apply -f fleio-redis-credentials.yaml
kubectl apply -f fleio-redis-connection.yaml

Create a fleiodeployment resource and admin credentials secret:

Create a kubenetes.io/basic-auth secret with Fleio admin credentials (replace and with your credentials):

cat <<EOT > fleio-admin-credentials.yaml
apiVersion: v1
kind: Secret
metadata:
  name: fleio-admin-credentials
type: kubernetes.io/basic-auth
stringData:
  username: "<username>"
  password: "<password>"
EOT

Create a fleiodeployment resource (replace and with your Fleio license and with public IP or FQDN of your machine):

cat <<EOT > fleio-deployment.yaml
apiVersion: "stable.fleio.com/v1"
kind: FleioDeployment
metadata:
  name: test
spec:
  license:
    uuid: "<license-UUID>"
    key: "<license-KEY>"
    
  databaseConnection: "fleio-mariadb-connection"
  redisConnection: "fleio-redis-connection"

  adminCredentialsSecret: "fleio-admin-credentials"
  domain: "<domainOrIP>"
EOT

Apply resources using kubectl:

kubectl apply -f fleio-admin-credentials.yaml
kubectl apply -f fleio-deployment.yaml

Once a fleiodeployment resource exists in the cluster the Fleio operator will deploy Fleio in cluster. After deployment finishes Fleio should be available af the domain or IP you specified over HTTP.

Deploying with helper script

Warning

This script is not intended to be used for production.

This script installs and configures Fleio, mariadb and redis in a kubernetes cluster. Run the script using the following command:

curl -s -o "deploy-fleio" "https://fleio.com/helm/deploy-fleio" && bash "deploy-fleio"