Beta - Installing Fleio in kubernetes using Fleio operator¶
Warning
This is a beta release, and is not intended for production use.
Hardware requirements¶
Since in Kubernetes Fleio starts multiple pods for services, the hardware requirements will be slightly higher than
docker hardware requirements. It is also recommended you run Fleio on a multi-node
Kubernetes cluster.
Installing fleio in a Microk8s cluster¶
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
Run the following commands to enable some MicroK8s extension needed by Fleio:
microk8s enable dashboard hostpath-storage registry ingress cert-manager
microk8s status --wait-ready
And then, add the current user to the microk8s group:
sudo usermod -a -G microk8s $USER
Re-login to apply group changes, then configure kubectl to connect to MicroK8s:
mkdir ~/.kube
microk8s config > ~/.kube/config
chmod 600 ~/.kube/config
Test that kubectl works using the following command:
kubectl get all
If everything is OK, you can continue with instructions from Deploying Fleio in Kubernetes using Fleio operator.
Installing Fleio in a generic Kubernetes cluster¶
Prerequisites¶
Fleio needs a cluster with the following:
a default storage class that supports automatic provisioning
nginx ingress and a nginx ingress class called
publiccert manager installed (https://cert-manager.io/)
kubectl must be installed and configured to access the cluster. helm is also needed.
Test that kubectl works using the following command:
kubectl get all
If everything is OK, you can continue with instructions from Deploying Fleio in Kubernetes using Fleio operator.
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
Install Fleio operator:
helm install fleio-operator fleio/fleio-operator
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 <username> and <password> 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 <hostname> and <databaseName> with your values):
cat <<EOT > fleio-mariadb-connection.yaml
apiVersion: "k8s.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 <username> and <password> with your
credentials, leave <username> 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 <hostname> with your value):
cat <<EOT > fleio-redis-connection.yaml
apiVersion: "k8s.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 <username> and <password>
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 <license-UUID> and <license-key> with your Fleio license and
<domainOrIP> with public IP or FQDN of your machine):
cat <<EOT > fleio-deployment.yaml
apiVersion: "k8s.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 at the domain or IP you specified over HTTP.
Deploying with a helper script¶
Warning
This deploy method is not intended for production use, we recomend using this only for testing.
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"