Skip to content

Storage

Use a Kubernetes PersistentVolumeClaim (PVC) to keep workload data after pod restarts or rescheduling.

spec.storageClassName selects the storage profile. The profile determines the storage backend and Kubernetes access mode.

Set spec.storageClassName and spec.resources.requests.storage in new PVC manifests. RemoteGPU sets spec.accessModes from the selected storage profile. If you include spec.accessModes, it must match that profile.

Supported storage profiles

RemoteGPU supports these PVC storage profiles.

ProfileStorage classAccess modeUse case
Block storagestorage-standardReadWriteOnceRead-write storage for one node
Shared storagestorage-shared-standardReadWriteManyRead-write storage across nodes

Choose shared storage only when multiple workloads need read-write access to the same filesystem volume. For single-node mounts, choose block storage.

PVC manifest fields

PVC manifests use these fields.

FieldRequiredSupported value
spec.storageClassNameYesstorage-standard or storage-shared-standard
spec.resources.requests.storageYes8Gi, 16Gi, 32Gi, 64Gi, 128Gi, 256Gi, 512Gi, 1Ti, or 2Ti
spec.accessModesNoOmit, or set the access mode for the selected storage class
spec.volumeModeNoFilesystem

If you omit spec.accessModes, RemoteGPU sets it from spec.storageClassName. If you set it explicitly, use ReadWriteOnce with storage-standard and ReadWriteMany with storage-shared-standard.

Create a PVC

Create a PVC manifest with a supported storage class and size.

Block storage PVC

Example block storage PVC:

yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: workspace
spec:
  storageClassName: storage-standard
  resources:
    requests:
      storage: 128Gi

Apply the manifest:

bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f pvc.yaml
kubectl --kubeconfig ./kubeconfig-team-ml.yaml get pvc workspace

Block storage supports read-write mounts on one node at a time.

Shared storage PVC

Example shared storage PVC:

yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: shared-workspace
spec:
  storageClassName: storage-shared-standard
  resources:
    requests:
      storage: 128Gi

Apply the manifest:

bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f shared-pvc.yaml
kubectl --kubeconfig ./kubeconfig-team-ml.yaml get pvc shared-workspace

Shared storage supports read-write mounts across nodes.

Attach storage to a deployment

Reference the PVC from a workload and mount it in the container.

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: persistent-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: persistent-demo
  template:
    metadata:
      labels:
        app: persistent-demo
        remotegpu.ai/runtime-sku: cpu-shared-8g
    spec:
      containers:
        - name: app
          image: nginx:1.27-alpine
          volumeMounts:
            - name: workspace
              mountPath: /workspace
      volumes:
        - name: workspace
          persistentVolumeClaim:
            claimName: workspace

Apply the deployment manifest with your namespace kubeconfig:

bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f deployment.yaml

Expand a PVC

To expand a PVC, increase spec.resources.requests.storage to a larger supported size:

yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: workspace
spec:
  storageClassName: storage-standard
  resources:
    requests:
      storage: 256Gi

Apply the manifest again:

bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f pvc.yaml

Kubernetes storage expansion is one-way. To move to a smaller volume, create a new PVC and copy the data.

Data lifecycle

A PVC owns the data stored for that claim. Deleting a deployment, job, or cronjob does not delete the PVC. Delete the PVC only when you no longer need the stored data.

Troubleshooting

SymptomWhat to check
PVC creation is rejectedCheck the storage class, requested size, and, if set, access mode.
PVC stays pendingCheck the PVC events with kubectl describe pvc; confirm the requested size is one of the supported sizes.
Workload does not see the mounted dataConfirm the workload references the correct claimName and the volumeMounts path matches the container path you expect.
Expansion does not applyIncrease the request to a larger supported size; shrinking an existing PVC is not supported.
Data disappeared after cleanupConfirm whether the PVC was deleted; delete a PVC only when the stored data is no longer needed.

If PVC creation is rejected because of spec.accessModes, omit the field or set the access mode for the selected storage class.

  • Read Deployments to mount a PVC in an application.
  • Read Services to expose a deployment inside the cluster.

RemoteGPU customer documentation