-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1601 from umagnus/release-1.29
[release-1.29] doc: add volume cloning doc
- Loading branch information
Showing
5 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Volume Cloning Example | ||
## Feature Status: Beta | ||
|
||
- supported from v1.29.1 | ||
|
||
## Create a Source PVC | ||
|
||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/storageclass-azurefile-csi.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/nginx-pod-azurefile.yaml | ||
``` | ||
|
||
### Check the Source PVC | ||
|
||
```console | ||
$ kubectl exec nginx-azurefile -- ls /mnt/azurefile | ||
outfile | ||
``` | ||
|
||
## Create a PVC from an existing PVC | ||
> Make sure application is not writing data to source fileshare | ||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/cloning/pvc-azurefile-cloning.yaml | ||
``` | ||
### Check the Creation Status | ||
|
||
```console | ||
$ kubectl describe pvc pvc-azurefile-cloning | ||
Name: pvc-azurefile-cloning | ||
Namespace: default | ||
StorageClass: azurefile-csi | ||
Status: Bound | ||
Volume: pvc-bcbc953a-0232-457b-9100-6f1305c48b85 | ||
Labels: <none> | ||
Annotations: pv.kubernetes.io/bind-completed: yes | ||
pv.kubernetes.io/bound-by-controller: yes | ||
volume.beta.kubernetes.io/storage-provisioner: file.csi.azure.com | ||
volume.kubernetes.io/storage-provisioner: file.csi.azure.com | ||
Finalizers: [kubernetes.io/pvc-protection] | ||
Capacity: 100Gi | ||
Access Modes: RWX | ||
VolumeMode: Filesystem | ||
DataSource: | ||
Kind: PersistentVolumeClaim | ||
Name: pvc-azurefile | ||
Used By: <none> | ||
Events: | ||
Type Reason Age From Message | ||
---- ------ ---- ---- ------- | ||
Normal ExternalProvisioning 4m41s (x2 over 4m54s) persistentvolume-controller waiting for a volume to be created, either by external provisioner "file.csi.azure.com" or manually created by system administrator | ||
Normal Provisioning 4m38s (x5 over 4m54s) file.csi.azure.com_aks-nodepool1-34988195-vmss000002_a240766c-7d4d-47f1-8f91-d97abbecad49 External provisioner is provisioning volume for claim "default/pvc-azurefile-cloning" | ||
Normal ProvisioningSucceeded 4m30s file.csi.azure.com_aks-nodepool1-34988195-vmss000002_a240766c-7d4d-47f1-8f91-d97abbecad49 Successfully provisioned volume pvc-bcbc953a-0232-457b-9100-6f1305c48b85 | ||
``` | ||
|
||
## Restore the PVC into a Pod | ||
|
||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/cloning/nginx-pod-restored-cloning.yaml | ||
``` | ||
|
||
### Check Sample Data | ||
|
||
```console | ||
$ kubectl exec nginx-azurefile-restored-cloning -- ls /mnt/azurefile | ||
outfile | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
kind: Pod | ||
apiVersion: v1 | ||
metadata: | ||
name: nginx-azurefile-restored-cloning | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
containers: | ||
- image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine | ||
name: nginx-azurefile-restored-cloning | ||
args: | ||
- sleep | ||
- "3600" | ||
volumeMounts: | ||
- name: azurefile-cloning | ||
mountPath: "/mnt/azurefile" | ||
volumes: | ||
- name: azurefile-cloning | ||
persistentVolumeClaim: | ||
claimName: pvc-azurefile-cloning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters