Appearance
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.
| Profile | Storage class | Access mode | Use case |
|---|---|---|---|
| Block storage | storage-standard | ReadWriteOnce | Read-write storage for one node |
| Shared storage | storage-shared-standard | ReadWriteMany | Read-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.
| Field | Required | Supported value |
|---|---|---|
spec.storageClassName | Yes | storage-standard or storage-shared-standard |
spec.resources.requests.storage | Yes | 8Gi, 16Gi, 32Gi, 64Gi, 128Gi, 256Gi, 512Gi, 1Ti, or 2Ti |
spec.accessModes | No | Omit, or set the access mode for the selected storage class |
spec.volumeMode | No | Filesystem |
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: 128GiApply the manifest:
bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f pvc.yaml
kubectl --kubeconfig ./kubeconfig-team-ml.yaml get pvc workspaceBlock 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: 128GiApply the manifest:
bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f shared-pvc.yaml
kubectl --kubeconfig ./kubeconfig-team-ml.yaml get pvc shared-workspaceShared 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: workspaceApply the deployment manifest with your namespace kubeconfig:
bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f deployment.yamlExpand 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: 256GiApply the manifest again:
bash
kubectl --kubeconfig ./kubeconfig-team-ml.yaml apply -f pvc.yamlKubernetes 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
| Symptom | What to check |
|---|---|
| PVC creation is rejected | Check the storage class, requested size, and, if set, access mode. |
| PVC stays pending | Check the PVC events with kubectl describe pvc; confirm the requested size is one of the supported sizes. |
| Workload does not see the mounted data | Confirm the workload references the correct claimName and the volumeMounts path matches the container path you expect. |
| Expansion does not apply | Increase the request to a larger supported size; shrinking an existing PVC is not supported. |
| Data disappeared after cleanup | Confirm 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 next
- Read Deployments to mount a PVC in an application.
- Read Services to expose a deployment inside the cluster.
