Velero plugin for jdcloud
220
This plugin is used for saving and retrieving backup data on JDCloud OSS as an object storage plugin. The backup includes metadata files of Kubernetes resources and CSI objects, as well as the progress of asynchronous operations. It is also used to store result data from backups and restores, including log files, warning/error files, and more.
Log in to a node in the JKE cluster and connect to the cluster.
Install the Velero CLI tool.
Download velero-v1.17.1-linux-amd64.tar.gz from the official website and upload it to the node.
Extract Velero:
tar -xvf velero-v1.17.1-linux-amd64.tar.gz
mv velero-v1.17.1-linux-amd64/velero /usr/local/bin/velero
Build the Velero plugin image.
Clone the Velero plugin repository:
git clone https://github.com/jd-opensource/velero-plugin-for-jdcloud.git
Build the image:
cd velero-plugin-for-jdcloud
make docker-build IMAGE="my.hub.com/base/velero-plugin-for-jdcloud" VERSION="v1.0.0"
Create a new OSS bucket. The bucket should not contain other directories.
Create a credentials configuration file.
mkdir velero
vi /home/velero/credentials-velero
Add the following content:
JDCLOUD_OSS_ACCESS_KEY=<Your AK>
JDCLOUD_OSS_SECRET_KEY=<Your SK>
Install Velero using the CLI tool.
velero install \
--provider jdcloud.com/jdcloud \
--plugins my.hub.com/base/velero-plugin-for-jdcloud:v1.0.0 \
--bucket <Your Bucket> \
--prefix "default-prefix/" \
--secret-file /home/velero/credentials-velero \
--backup-location-config \
endpoint=<Your Endpoint>,region="cn-north-1",s3ForcePathStyle="true",bucket="my-bucket",profile="default",insecureSkipTLSVerify="true",credentialsFile="/credentials/cloud"
Replace <Your Bucket> and <Your Endpoint> with your bucket name and endpoint.
Enter the JKE cluster, upgrade the Velero workload, replace the image with the one uploaded to JD Image Serve.
Check the storage location status.
velero backup-location get
available indicates a successful installation.
Backup data.
Backup all resources in the default namespace:
velero backup create default-backup --include-namespaces default
Check if the backup was successful:
velero backup get
completed indicates the backup was successful.
View details and logs:
velero backup describe default-backup
velero backup logs default-backup
Delete resources in the default namespace.
Restore resources.
Update the backup storage location to read-only mode:
kubectl patch backupstoragelocation default \
--namespace velero \
--type merge \
--patch '{"spec":{"accessMode":"ReadOnly"}}'
Restore resources using the created backup:
velero restore create --from-backup default-backup
Check the restore status:
velero restore get
completed indicates a successful restore.
Restore the backup storage location to read-write mode:
kubectl patch backupstoragelocation default \
--namespace velero \
--type merge \
--patch '{"spec":{"accessMode":"ReadWrite"}}'
Delete a backup.
velero backup delete default-backup
Uninstall Velero resources.
kubectl delete namespace/velero clusterrolebinding/velero
kubectl delete crds -l component=velero
Content type
Image
Digest
sha256:a94c9247a…
Size
24.2 MB
Last updated
8 months ago
docker pull jdopensource/velero-plugin-for-jdcloud:v1.0.0