-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
90 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,66 @@ | ||
# Volume Cloning Example | ||
## Feature Status: Beta | ||
|
||
- supported from v1.23.2 | ||
|
||
## Create a Source PVC | ||
|
||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/storageclass-blobfuse2.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/pvc-blob-csi.yaml | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/nginx-pod-blob.yaml | ||
``` | ||
|
||
### Check the Source PVC | ||
|
||
```console | ||
$ kubectl exec nginx-blob -- ls /mnt/blob | ||
outfile | ||
``` | ||
|
||
## Create a PVC from an existing PVC | ||
> Make sure application is not writing data to source blob container | ||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/cloning/pvc-blob-cloning.yaml | ||
``` | ||
### Check the Creation Status | ||
|
||
```console | ||
$ kubectl describe pvc pvc-blob-cloning | ||
Name: pvc-blob-cloning | ||
Namespace: default | ||
StorageClass: blob-fuse | ||
Status: Bound | ||
Volume: pvc-6db5af93-3b32-4c24-a68e-b727d7801fd5 | ||
Labels: <none> | ||
Annotations: kubectl.kubernetes.io/last-applied-configuration: | ||
{"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"pvc-blob-cloning","namespace":"default"},"spec":{"a... | ||
pv.kubernetes.io/bind-completed: yes | ||
pv.kubernetes.io/bound-by-controller: yes | ||
volume.beta.kubernetes.io/storage-provisioner: blob.csi.azure.com | ||
volume.kubernetes.io/storage-provisioner: blob.csi.azure.com | ||
Finalizers: [kubernetes.io/pvc-protection] | ||
Capacity: 100Gi | ||
Access Modes: RWX | ||
VolumeMode: Filesystem | ||
Mounted By: <none> | ||
Events: | ||
Type Reason Age From Message | ||
---- ------ ---- ---- ------- | ||
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" | ||
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 | ||
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 | ||
``` | ||
|
||
## Restore the PVC into a Pod | ||
|
||
```console | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/cloning/nginx-pod-restored-cloning.yaml | ||
``` | ||
|
||
### Check Sample Data | ||
|
||
```console | ||
$ kubectl exec nginx-blob-restored-cloning -- ls /mnt/blob | ||
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-blob-restored-cloning | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
containers: | ||
- image: mcr.microsoft.com/oss/nginx/nginx:1.17.3-alpine | ||
name: nginx-blob-restored-cloning | ||
args: | ||
- sleep | ||
- "3600" | ||
volumeMounts: | ||
- name: blob-cloning | ||
mountPath: "/mnt/blob" | ||
volumes: | ||
- name: blob-cloning | ||
persistentVolumeClaim: | ||
claimName: pvc-blob-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