1. Home
  2. Knowledge Base
  3. Product
  4. Compute
  5. Configuring Dynamic Storage on CloudPE (Kubernetes)

Configuring Dynamic Storage on CloudPE (Kubernetes)

Overview

This guide explains how to configure dynamic storage provisioning in a Kubernetes cluster using CloudPE (OpenStack Cinder). Dynamic provisioning allows Kubernetes to automatically create and attach storage volumes when required—eliminating the need for manual disk management.


✅ Prerequisites

Before you begin, ensure the following:

  • A running Kubernetes cluster (Master + Worker nodes)
  • Cinder CSI driver installed (included in most CloudPE K8s templates)
  • Access to the CloudPE Dashboard
  • Permissions to create Kubernetes resources (StorageClass, PVC, Pods)

🔍 Step 1: Identify Storage Tiers in CloudPE

Kubernetes needs to know which storage tier to use.

  1. Log in to the CloudPE Dashboard
  2. Navigate to:
    Compute → Volumes → Create Volume
  3. Locate the Storage Policy / Volume Type dropdown
  4. Note the exact names (case-sensitive), for example:
    • Pro NVMe
    • Standard NVMe
    • default

⚠️ These names must match exactly when used in Kubernetes.


⚙️ Step 2: Create a Kubernetes StorageClass

The StorageClass defines how storage is dynamically provisioned.

Create a file:

nano storage-class.yaml

Add the following configuration:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: cloudpe-nvme-ssd
provisioner: cinder.csi.openstack.org
parameters:
  type: "Pro NVMe"          # Must match CloudPE volume type
  availability: nova
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

Apply the configuration:

kubectl apply -f storage-class.yaml

📦 Step 3: Create a PersistentVolumeClaim (PVC)

A PVC is a request for storage.

Create a file:

nano test-pvc.yaml

Add:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-data-disk
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: cloudpe-nvme-ssd
  resources:
    requests:
      storage: 5Gi

Apply:

kubectl apply -f test-pvc.yaml

🚀 Step 4: Use the Storage in a Pod

The volume will be created only when a Pod uses it due to WaitForFirstConsumer.

Create a file:

nano test-pod.yaml

Add:

apiVersion: v1
kind: Pod
metadata:
  name: storage-app
spec:
  containers:
  - name: web-server
    image: nginx
    volumeMounts:
    - mountPath: "/data"
      name: my-volume
  volumes:
  - name: my-volume
    persistentVolumeClaim:
      claimName: test-data-disk

Apply:

kubectl apply -f test-pod.yaml

🔄 Step 5: Verify the Setup

Once the Pod starts, Kubernetes will:

  • Request storage from CloudPE
  • Create a volume (e.g., 5Gi)
  • Attach it to the Worker Node
  • Mount it inside the Pod at /data

Useful Commands:

kubectl get sc          # List StorageClasses
kubectl get pvc         # Check PVC status (should be Bound)
kubectl get pods        # Verify Pod is Running
kubectl exec <pod-name> -- df -h /data   # Confirm mount

💡 Pro Tip: Set a Default StorageClass

To avoid specifying storageClassName every time:

kubectl patch storageclass cloudpe-nvme-ssd \
-p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

📌 Key Benefits

  • Fully automated volume provisioning
  • Faster deployment workflows
  • No manual disk management required
  • Scalable and cloud-native storage handling

❗ Troubleshooting Tips

  • Ensure volume type names match exactly
  • Check if Cinder CSI driver is running
  • Verify Kubernetes events: kubectl describe pvc <pvc-name>
  • Confirm CloudPE quotas are not exceeded

Was this article helpful?

Related Articles

This is a staging environment