Kubernetes CSI Specifications
  • 14 Apr 2024
  • 1 Minute to read
  • Dark
    Light

Kubernetes CSI Specifications

  • Dark
    Light

Article summary

Auto Provision for CSI

The following is relevant for AWS EKS and Azure AKS for creating an Auto-Provisioned (AP) volume from the CSI ecosystem.

  • AP will create Media Nodes outside of the cluster; not as part of the NodeGroups cluster.

  • The Boolean flag for AP will be passed as a parameter in the StorageClass.yaml to enable the feature.

Flows

AP for CSI supports these flows:

  1. Simple Predictive Flow - restricted for Dynamic Provisioning only, and restricted to 1 zone only.

    • The user will create a simple flow StorageClass.yaml with binding mode volumeBindingMode: WaitForFirstConsumer, and then apply a PVC and a deployment (an application to be attached to the PVC).

    • Once deployment is applied, the K8S scheduler will select a node on which to create the deployment. The CSI createVolume request gets that node data (including VPC and Subnet) and will execute createVolumeAutoProvision with those node parameters.

  2. Advanced User Flow -

    • In the StorageClass.yaml the user will provide all relevant data for AP as parameters, such as Subnets and Zones.

    • CSI will call AP as in the regular EC2/VM flow.

Retrieving Metadata in Azure AKS

Part of the NodeServer's sidecar responsibility is to retrieve the relevant current node metadata such as VPC. AP creation for Azure must have the VPC where the AKS cluster’s nodes are deployed. Due to the nature of the Azure node and the IDs being created (Volumez customized ID), the only way to retrieve the VPC is through the Tenant Cloud Resources (TCR) service. Therefore, each time the NodeServer sidecar starts up, a GetVMMetadataByRegion request is created for the TCR service.

Examples

All the AP YAMLs for CSI can be found at https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/

Applying the StorageClass

  1. Choose the correct flow (simple or advanced) by applying the StorageClass with the relevant parameters:

    Simple Predictive Flow: Apply the following “simple“ StorageClass: https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/storageclass.yaml

    • apiVersion: storage.k8s.io/v1

    • kind: StorageClass

    • metadata:

    • name: ayal-sc

    • provisioner: vlz

    • parameters:

      • Policy: pol2

      • AutoProvisionMode: "true"

      • allowVolumeExpansion: true

        volumeBindingMode: WaitForFirstConsumer

    Advanced User Flow: Apply “advanced” StorageClass:

    AWS EKS - https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/eks-storageclass-params.yaml

  • apiVersion: storage.k8s.io/v1

  • kind: StorageClass

  • metadata:

  • name: ayal-sc

  • provisioner: vlz

  • parameters:

    • Policy: pol1

    • VolumeType: file

    • AutoProvisionMode: "true"

    • Zones: '[ "us-east-1a", "us-east-1b" ]'

    • Subnets: '[ "subnet-066131cf91f58cb63", "subnet-0f71962ab8e7d8e26" ]'

    • allowVolumeExpansion: true

      volumeBindingMode: WaitForFirstConsumer

Azure AKS: https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/aks-storageclass-params.yaml

  • apiVersion: storage.k8s.io/v1

  • kind: StorageClass

  • metadata:

  • name: aks-ap-params-sc

  • provisioner: vlz

  • parameters:

    • Policy: policy1

    • VolumeType: file

    • AutoProvisionMode: "true"

    • Zones: '[ "1", "2" ]'

    • Subnets: '[ "/subscriptions/453b58fc-f031-4f46-9d1a-b35f725143f4/resourceGroups/avivl-vlz-8109-ap-1h128-rg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/avivl-vlz-8109-ap-1h128-1h128-sn" ]'

    • allowVolumeExpansion: true

      volumeBindingMode: WaitForFirstConsumer

  1. Apply PVC https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/pvc.yaml Note: Nothing will happen yet, due to DynamicProvisioning.

  2. Apply Deployment https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/deployment.yaml or https://bitbucket.org/volumez/csi/src/master/examples/kubernetes/autoprovision/fio-deployment.yaml

  3. Wait about 3 minutes. You can track the progress in the UI.


Was this article helpful?