💾 Storage
A container's disk is temporary: when the pod is recreated, everything that was on it is lost. To store data that must survive (databases, uploads, files), Kubernetes uses persistent disks.
| Term | What it is | Analogy |
|---|---|---|
| StorageClass | The type of disk available (for example, SSD) | The disk catalog |
| PVC (PersistentVolumeClaim) | The request for a disk, with a size | The purchase order |
| PV (PersistentVolume) | The disk itself, created automatically from the request | The delivered disk |
In practice, you only create the PVC. The cluster creates the disk on its own.
The PVC is created with kubectl. The created disk can also be viewed in the Nuvion Panel (step 6).
🚀 Before you start
- Have cluster access configured (see Cluster Access).
🚀 1. See the available disk types
kubectl get storageclass
Note the name of the class marked (default). It is used when you do not
choose one.
🚀 2. Request a disk (create the PVC)
Create the file pvc-dados.yaml:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-dados
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
kubectl apply -f pvc-dados.yaml
If the list from step 1 has no (default) class, add the line
storageClassName: CLASS-NAME inside spec.
ReadWriteOnce means the disk can be used by one node at a time.
🚀 3. Check the request
kubectl get pvc pvc-dados
The STATUS should be Bound (disk delivered). In some clusters the status
stays Pending until a pod uses the disk, and that is normal. Go to step 4.
🚀 4. Use the disk in a pod
Create the file pod-storage.yaml. Each time the pod starts, it writes the date
and time to the file /dados/historico.txt:
apiVersion: v1
kind: Pod
metadata:
name: pod-storage
spec:
containers:
- name: app
image: busybox
command: ["sh", "-c", "date >> /dados/historico.txt; sleep 3600"]
volumeMounts:
- name: dados
mountPath: /dados
volumes:
- name: dados
persistentVolumeClaim:
claimName: pvc-dados
kubectl apply -f pod-storage.yaml
kubectl get pvc pvc-dados
kubectl exec pod-storage -- cat /dados/historico.txt
The PVC becomes Bound and the file shows one line with the date.
🚀 5. Prove that the data survives
Delete the pod and create it again:
kubectl delete pod pod-storage
kubectl apply -f pod-storage.yaml
kubectl exec pod-storage -- cat /dados/historico.txt
Now the file shows two lines: the previous one and the new one. The pod was recreated, but the disk kept the data.
🚀 6. See the created disk
- 🖥️ Nuvion Panel
- ⌨️ kubectl (CLI)
Go to Compute > Volumes and look for a new 1 GiB volume, created automatically by the cluster.

kubectl get pv
The CLAIM column shows default/pvc-dados.
✅ How to know it worked
The file /dados/historico.txt accumulates a new line each time the pod is recreated.
When you delete the PVC, the disk and all data are erased (in the default configuration). Deleting only the pod erases nothing.
❗ Common problems
| Symptom | Cause | Solution |
|---|---|---|
PVC Pending and the pod too | No default StorageClass | Add storageClassName to the PVC (step 2) |
Pod stuck in ContainerCreating | The disk is still being prepared | Wait and see the Events section in kubectl describe pod pod-storage |
Multi-Attach error | ReadWriteOnce disk in use by a pod on another node | Use only one pod with this disk, or make sure they stay on the same node |
| Requested size larger than allowed | Volume limit or quota | Request a smaller size or contact support |
🧹 Cleanup
kubectl delete pod pod-storage
kubectl delete pvc pvc-dados
The second command erases the disk and the data.
➡️ Next step: Networking
🧠 Questions?
Talk to our SaveinCloud technical support team!