Commit f7cf9ba9 by 流生

update examples and readme file

parent 32b48cc3
...@@ -149,7 +149,7 @@ For more information, see [the AlibabaCloud documentation on RAM users guides][1 ...@@ -149,7 +149,7 @@ For more information, see [the AlibabaCloud documentation on RAM users guides][1
Create a backup: Create a backup:
`velero backup create nginx-backup --include-namespaces nginx-example` `velero backup create nginx-backup --include-namespaces nginx-example --wait`
Destroy the nginx example: Destroy the nginx example:
...@@ -157,32 +157,29 @@ For more information, see [the AlibabaCloud documentation on RAM users guides][1 ...@@ -157,32 +157,29 @@ For more information, see [the AlibabaCloud documentation on RAM users guides][1
Create a restore from nginx-backup: Create a restore from nginx-backup:
`velero restore create --from-backup nginx-backup` `velero restore create --from-backup nginx-backup --wait`
2. nginx example with persistent volumes 2. nginx example with persistent volumes
Run the following command to create a nginx example with persistent volumes: Run the following command to create a nginx example with persistent volumes:
``` ```
VOLUME_ID=<YOUR_ECS_DISK_ID>
sed -i "s#<PV_NAME>#$VOLUME_ID#" examples/with-pv.yaml
kubectl apply -f examples/with-pv.yaml kubectl apply -f examples/with-pv.yaml
``` ```
Create a backup: Create a backup:
`velero backup create nginx-backup-volume --snapshot-volumes --include-namespaces nginx-example` `velero backup create nginx-backup-volume --include-namespaces nginx-example --wait`
Destroy the nginx example: Destroy the nginx example:
``` ```
kubectl delete namespaces nginx-example kubectl delete namespaces nginx-example
kubectl delete pv $(kubectl get pv|grep nginx-example/nginx-logs|cut -d ' ' -f1)
``` ```
Create a restore from nginx-backup-volume: Create a restore from nginx-backup-volume:
`velero restore create --from-backup nginx-backup-volume --restore-volumes` `velero restore create --from-backup nginx-backup-volume --wait`
[14]: https://www.alibabacloud.com/help/doc-detail/28645.htm [14]: https://www.alibabacloud.com/help/doc-detail/28645.htm
......
...@@ -22,33 +22,8 @@ metadata: ...@@ -22,33 +22,8 @@ metadata:
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolume
metadata:
annotations:
pv.kubernetes.io/bound-by-controller: "yes"
labels:
alicloud-pvname: <PV_NAME>
name: <PV_NAME>
namespace: nginx-example
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 20Gi
flexVolume:
driver: alicloud/disk
fsType: ext4
options:
volumeId: <PV_NAME>
storageClassName: disk
---
apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
annotations:
pv.kubernetes.io/bind-completed: "yes"
pv.kubernetes.io/bound-by-controller: "yes"
name: nginx-logs name: nginx-logs
namespace: nginx-example namespace: nginx-example
spec: spec:
...@@ -57,11 +32,7 @@ spec: ...@@ -57,11 +32,7 @@ spec:
resources: resources:
requests: requests:
storage: 20Gi storage: 20Gi
selector: storageClassName: alicloud-disk-ssd
matchLabels:
alicloud-pvname: <PV_NAME>
storageClassName: disk
volumeName: <PV_NAME>
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1beta1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment