Storage Setup

How to setup Persistent Storage for your Frontier Management Cluster (FMC)

OpenEBS Method

Cluster Creation Deployment Output

Available persistent storage sources are very important to Frontier Kubernetes Platform (FKP) FMC and workload clusters. An open-source method recommended and available to FKP organizations is called OpenEBS. This will allow users to have all their FKP clusters packaged with persistent storage free-of-charge. FKP FMCs will come pre-packaged with OpenEBS already installed.

What is OpenEBS?

OpenEBS turns any storage available to Kubernetes worker nodes into Local or Distributed Kubernetes Persistent Volumes. OpenEBS helps Application and Platform teams easily deploy Kubernetes Stateful Workloads that require fast and highly durable, reliable and scalable Container Attached Storage.

Why do users prefer OpenEBS?

The OpenEBS Adoption stories, mention the top reasons driving users towards OpenEBS as:

  • OpenEBS provides consistency across all Kubernetes distributions - On-premise and Cloud.
  • OpenEBS with Kubernetes increases Developer and Platform SRE Productivity.
  • OpenEBS is Easy to use compared to other solutions, for eg trivial to install & enabling entirely dynamic provisioning.
  • OpenEBS has Excellent Community Support.
  • OpenEBS is completely Open Source and Free.

For more information on OpenEBS, please visit their documentation website.

Pre-requisites

To continue this setup guide, you would have to have completed the previous section tutorial FMC Setup & Installation. The preparations for any storage databases require pre-packaged OpenEBS with your FMC cluster. We will be using PostgreSQL database as an example running on Stackgres.

What is Stackgres?

Stackgres is known for being a full-stack PostgresSQL distribution for Kubernetes. It creates an ecosystem comprised of many components surrounding the PostgreSQL database required for an easy production deployment known as the PostgreSQL stack. For more information on Stackgres, please visit their documentation website here.

Deploy an Stackgres Cluster (SGCluster)

Acting as the main CRD component, we have the SGCluster that drives the Postgres cluster creation. To deploy a SGCluster, we will run the manifest down below:

apiVersion: stackgres.io/v1
kind: SGCluster
metadata:
  name: frontier-db
spec:
  postgres:
    version: "latest"
  instances: # <= Integer depending on the number of workload nodes found within your FKP cluster
  pods:
    persistentVolume:
      size: "####Gi" # <= the size of the persistent volume
      storageClass: "????" <= the name of the storage class
  prometheusAutobind: false

Ensure that you change some values in their depending on your FKP cluster build. You will need to input the correct PostgreSQL version and the number of instances pertaining the quantity of worker nodes you have in your cluster. You will also need to adjust the size of the persistentVolume along with the storageClass’s name. You can check the status of the database creativity by pulling the database pods.

Cluster with OpenEBS-Stackgres-Postgres Installed Pods

You can see frontier-db-0 and frontier-db-1 containers running containing the PostgreSQL database. You can run the follwing command to get statuses on your Postgres database pods.

sudo k3s kubectl exec -ti "$(kubectl get pod --selector app=StackGresCluster,cluster=true -o name | head -n 1)" -c patroni -- patronictl list

Here you will see all the write and read database pods scattered throughout your FMC cluster.

Access the Stackgres Graphical User-Interface (GUI)

To access the Stackgres GUI, we can take a look at services within our FMC so we can view the the stackgres-restapi load balancer offered by Stackgres:

Stackgres Services

This is the Stackgres RESTAPI server you can use to manage your databases within your FKP cluster using OpenEBS. You will be required credentials to use the Stackgres GUI. To retrieve the password needed for authentication, enter the following command into your FKP cluster node:

sudo k3s kubectl get secret -n stackgres stackgres-restapi --template ''

The username used for the account is admin. You can use the external IP address to access the Stackgres GUI.

Setup Post-Requisites

With the PostgreSQL database now being up-and-available in your FMC cluster, you can now deploy Keycloak and Frontier API Services (FAS) container to enable organization staff management features for FKP services. You can continue your FMC setup by visiting these following guides in the following order: