Skip to content

Commit 7d79b37

Browse files
authored
Merge pull request #1129 from umagnus/add_volume_cloning_doc
doc: add volume cloning doc
2 parents b6a201b + d713079 commit 7d79b37

File tree

5 files changed

+90
-2
lines changed

5 files changed

+90
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ This option does not depend on cloud provider config file, supports cross subscr
6262
- [Basic usage](./deploy/example/e2e_usage.md)
6363
- [NFSv3](./deploy/example/nfs)
6464
- [fsGroupPolicy](./deploy/example/fsgroup)
65+
- [Volume cloning](./deploy/example/cloning)
6566
- [Workload identity](./docs/workload-identity.md)
6667
6768
### Troubleshooting

deploy/example/cloning/README.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Volume Cloning Example
2+
## Feature Status: Beta
3+
4+
- supported from v1.23.2
5+
6+
## Create a Source PVC
7+
8+
```console
9+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/storageclass-blobfuse2.yaml
10+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/pvc-blob-csi.yaml
11+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/nginx-pod-blob.yaml
12+
```
13+
14+
### Check the Source PVC
15+
16+
```console
17+
$ kubectl exec nginx-blob -- ls /mnt/blob
18+
outfile
19+
```
20+
21+
## Create a PVC from an existing PVC
22+
> Make sure application is not writing data to source blob container
23+
```console
24+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/cloning/pvc-blob-cloning.yaml
25+
```
26+
### Check the Creation Status
27+
28+
```console
29+
$ kubectl describe pvc pvc-blob-cloning
30+
Name: pvc-blob-cloning
31+
Namespace: default
32+
StorageClass: blob-fuse
33+
Status: Bound
34+
Volume: pvc-6db5af93-3b32-4c24-a68e-b727d7801fd5
35+
Labels: <none>
36+
Annotations: kubectl.kubernetes.io/last-applied-configuration:
37+
{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"pvc-blob-cloning","namespace":"default"},"spec":{"a...
38+
pv.kubernetes.io/bind-completed: yes
39+
pv.kubernetes.io/bound-by-controller: yes
40+
volume.beta.kubernetes.io/storage-provisioner: blob.csi.azure.com
41+
volume.kubernetes.io/storage-provisioner: blob.csi.azure.com
42+
Finalizers: [kubernetes.io/pvc-protection]
43+
Capacity: 100Gi
44+
Access Modes: RWX
45+
VolumeMode: Filesystem
46+
Mounted By: <none>
47+
Events:
48+
Type Reason Age From Message
49+
---- ------ ---- ---- -------
50+
Normal Provisioning 16s blob.csi.azure.com_aks-nodepool1-34988195-vmss000002_8ecdf8ad-b636-4ca5-81ee-0f1a49337168 External provisioner is provisioning volume for claim "default/pvc-blob-cloning"
51+
Normal ExternalProvisioning 14s (x3 over 16s) persistentvolume-controller waiting for a volume to be created, either by external provisioner "blob.csi.azure.com" or manually created by system administrator
52+
Normal ProvisioningSucceeded 8s blob.csi.azure.com_aks-nodepool1-34988195-vmss000002_8ecdf8ad-b636-4ca5-81ee-0f1a49337168 Successfully provisioned volume pvc-6db5af93-3b32-4c24-a68e-b727d7801fd5
53+
```
54+
55+
## Restore the PVC into a Pod
56+
57+
```console
58+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/cloning/nginx-pod-restored-cloning.yaml
59+
```
60+
61+
### Check Sample Data
62+
63+
```console
64+
$ kubectl exec nginx-blob-restored-cloning -- ls /mnt/blob
65+
outfile
66+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
kind: Pod
3+
apiVersion: v1
4+
metadata:
5+
name: nginx-blob-restored-cloning
6+
spec:
7+
nodeSelector:
8+
kubernetes.io/os: linux
9+
containers:
10+
- image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine
11+
name: nginx-blob-restored-cloning
12+
args:
13+
- sleep
14+
- "3600"
15+
volumeMounts:
16+
- name: blob-cloning
17+
mountPath: "/mnt/blob"
18+
volumes:
19+
- name: blob-cloning
20+
persistentVolumeClaim:
21+
claimName: pvc-blob-cloning

deploy/example/pvc-blob-csi-clone.yaml renamed to deploy/example/cloning/pvc-blob-csi-cloning.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: PersistentVolumeClaim
44
metadata:
5-
name: pvc-blob-clone
5+
name: pvc-blob-cloning
66
namespace: default
77
spec:
88
accessModes:

hack/verify-yamllint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [[ "${deployDirNum}" != "${helmDirNum}" ]]; then
2929
exit 1
3030
fi
3131

32-
for path in "deploy/*.yaml" "deploy/example/*.yaml" "deploy/example/metrics/*.yaml"
32+
for path in "deploy/*.yaml" "deploy/example/*.yaml" "deploy/example/metrics/*.yaml" "deploy/example/cloning/*.yaml"
3333
do
3434
echo "checking yamllint under path: $path ..."
3535
yamllint -f parsable $path | grep -v "line too long" > $LOG

0 commit comments

Comments
 (0)