Standard CSI Storage
Standard CSI storage provides local persistent volumes for your Kubernetes workloads.
Standard storage is block storage that binds to a specific node. It does not support ReadWriteMany access mode across multiple nodes. For shared storage across nodes, use NFS storage instead.
Setup
1. Create Storage Class
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: standard
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: vcloud.csi.vnetwork.dev
parameters:
fsType: "ext4"
uid: "1001"
gid: "1001"
permission: "0755"
mountFlags: "noatime,nodiratime"
allowVolumeExpansion: true
#volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Retain
2. Create PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: example-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: standard
Usage Example
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
spec:
replicas: 1
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
containers:
- name: app
image: nginx
volumeMounts:
- name: storage
mountPath: /data
volumes:
- name: storage
persistentVolumeClaim:
claimName: example-pvc
Managing Volume Snapshots
Standard CSI storage volumes support snapshot management through the cloud infrastructure interface.
Volume Snapshots Overview
Volume snapshots provide point-in-time backups of your storage volumes, allowing you to:
- Create backups before making changes
- Restore volumes to previous states
- Migrate data between instances
Creating Snapshots
- Navigate to your instance in the cloud console
- Go to the Instance Volumes section
- Click Create Snapshot for the desired volume
- Provide a snapshot name and description
Managing Snapshots
In the Volume Snapshots section, you can:
- View all snapshots with their status and details
- Revert volumes to previous snapshot states
- Delete snapshots when no longer needed
Snapshot Operations
Action | Description | Requirements |
---|---|---|
Create | Take a point-in-time backup | Volume must be attached |
Revert | Restore volume to snapshot state | Instance must be stopped |
Delete | Remove snapshot permanently | Snapshot must be inactive |
Important: Snapshots can only be reverted when the instance is stopped. Please stop the instance before attempting to revert any snapshots. CSI Snapshot: Expect snapshot support for this CSI-level in the near future, as we're prioritizing its implementation.
Troubleshooting
# Check PVC status
kubectl get pvc example-pvc
kubectl describe pvc example-pvc