Creating Storage Classes for Your Saagie Platform

Use this tutorial to create storage classes to store data in a non-volatile device during and after the execution of your platform.

Storage classes are stored in a file named storage.yml which contains the configuration for your storageClass resources:

  • common-storageclass: Used to store Saagie data, such as databases.

  • <prefix>-storageclass: Used to store job data, such as uploaded artifacts.

  • <prefix>-app-storageclass: Optional storageClass used to store app data and job data on a different provisioner.

    The <prefix> value is the same value you chose when you determined your DNS entry at the beginning of the installation process.
Before you begin:

Make sure you have completed all the previous steps, Installing and Setting Up Saagie.

  1. Create the storage.yml file for your Kubernetes cluster.

    • Amazon EKS storage.yml file

    • Azure AKS storage.yml file

    • Google GKE storage.yml file

    • Other Service Provider storage.yml file

    The following sample storage.yml file for Amazon EKS can be customized according to your needs.

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: common-storageclass
    parameters:
      type: gp2
      fsType: ext4
    provisioner: kubernetes.io/aws-ebs
    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-storageclass (1)
    parameters:
      type: gp2
      fsType: ext4
    provisioner: kubernetes.io/aws-ebs

    To store app data and job data on different provisioners, include the following lines in the same storage.yml file:

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-app-storageclass (1)
    parameters: (2)
    
    provisioner: (3)

    Where:

    1 <prefix> must be replaced with the same value determined for your DNS entry at the beginning of the installation process.
    The <prefix> value must be a string of up to 12 lowercase alphanumeric characters with no special characters.
    2 parameters must contain the parameters for app data.
    3 provisioner must indicate your second provisioner used to store app data.

    The following sample storage.yml file for Azure AKS can be customized according to your needs.

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: common-storageclass
    parameters:
      cachingmode: ReadOnly
      kind: Managed
      storageaccounttype: Standard_LRS
    provisioner: kubernetes.io/azure-disk
    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-storageclass (1)
    parameters:
      cachingmode: ReadOnly
      kind: Managed
      storageaccounttype: Standard_LRS
    provisioner: kubernetes.io/azure-disk

    To store app data and job data on different provisioners, include the following lines in the same storage.yml file:

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-app-storageclass (1)
    parameters: (2)
    
    provisioner: (3)

    Where:

    1 <prefix> must be replaced with the same value determined for your DNS entry at the beginning of the installation process.
    The <prefix> value must be a string of up to 12 lowercase alphanumeric characters with no special characters.
    2 The parameters value must contain the parameters for app data.
    3 The provisioner value must indicate your second provisioner used to store app data.

    The following sample storage.yml file for Google GKE can be customized according to your needs.

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: common-storageclass
    parameters:
      type: pd-standard
    provisioner: kubernetes.io/gce-pd
    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-storageclass (1)
    parameters:
      type: pd-standard
    provisioner: kubernetes.io/gce-pd

    To store app data and job data on different provisioners, include the following lines in the same storage.yml file:

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-app-storageclass (1)
    parameters: (2)
    
    provisioner: (3)

    Where:

    1 <prefix> must be replaced with the same value determined for your DNS entry at the beginning of the installation process.
    The <prefix> value must be a string of up to 12 lowercase alphanumeric characters with no special characters.
    2 The parameters value must contain the parameters for app data.
    3 The provisioner value must indicate your second provisioner used to store app data.

    The following sample storage.yml file for OVH can be customized according to your needs.
    For more information, see the Kubernetes documentation.

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: common-storageclass
    parameters:
      availability: nova
      type: classic
    provisioner: cinder.csi.openstack.org
    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-storageclass (1)
    parameters:
      availability: nova
      type: classic
    provisioner: cinder.csi.openstack.org

    To store app data and job data on different provisioners, include the following lines in the same storage.yml file:

    ---
    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: <prefix>-app-storageclass (1)
    parameters: (2)
    
    provisioner: (3)

    Where:

    1 <prefix> must be replaced with the same value determined for your DNS entry at the beginning of the installation process.
    The <prefix> value must be a string of up to 12 lowercase alphanumeric characters with no special characters.
    2 The parameters value must contain the parameters for app data.
    3 The provisioner value must indicate your second provisioner used to store app data.
  2. Apply the storage.yml file by running the following command line:

    kubectl apply -f storage.yml
  3. Confirm that the storage classes are available by running the following command line:

    kubectl get sc

    The output of the command should look like the following for Amazon EKS:

    NAME                   PROVISIONER              RECLAIMPOLICY    VOLUMEBINDINGMODE     ALLOWVOLUMEEXPANSION   AGE
    common-storageclass    kubernetes.io/aws-ebs    Delete           Immediate             false                  2m43s
    gp2 (default)          kubernetes.io/aws-ebs    Delete           WaitForFirstConsumer  false                  5h25s
    <prefix>-storageclass  kubernetes.io/aws-ebs    Delete           Immediate             false                  30s