Last active
September 30, 2020 14:26
-
-
Save ikurni/886bba4e82b51141d636db42782c4e39 to your computer and use it in GitHub Desktop.
Deploy Minio and Velero for Kubernetes Based Migration
This file contains hidden or 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
### Get velero images ### | |
wget https://github.com/vmware-tanzu/velero/releases/download/v1.2.0/velero-v1.2.0-linux-amd64.tar.gz | |
tar -xvzf velero-v1.2.0-linux-amd64.tar.gz | |
cp velero-v1.2.0-linux-amd64/velero /usr/local/bin/ | |
### Deploy Minio ### | |
oc apply -f /root/velero-v1.2.0-linux-amd64/examples/minio/00-minio-deployment.yaml | |
docker run -it --entrypoint=/bin/sh minio/mc | |
mc config host add s3 http://minio-service-ip:9000 (minio url) minio minio123 | |
oc set volume deployment.apps/minio --add --name=storage -t pvc --claim-name=minio-pv-claim --overwrite | |
docker run -it --entrypoint=/bin/sh minio/mc | |
mc config host add s3 http://minio-service-ip:9000 minio minio123 | |
mc mb s3/velero | |
### Configure Velero ### | |
cat credentials-velero | |
[default] | |
aws_access_key_id = minio | |
aws_secret_access_key = minio123 | |
velero install \ | |
--provider aws --bucket velero \ | |
--secret-file ./credentials-velero \ | |
--use-volume-snapshots=false \ | |
--backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://minio.velero.svc:9000 \ | |
--plugins velero/velero-plugin-for-aws:v1.0.0 | |
### Backup and Restore using Velero ### | |
#Backup in the source kubernetes# | |
velero backup create nginx-backup --include-namespace=xxx | |
#Restore in the destination kubernetes# | |
velero restore create nginx-backup --from-backup nginx-backup | |
### Copy Image Streams from Source to Destination ### | |
podman login -u user -p $(oc whoami -t) docker-registry-default.apps.oldocp.com --tls-verify=false | |
podman login -u user -o $(oc whoami -t) docker-registry-default.apps.newocp.com --tls-verify=false | |
#Use Skopeo to Copy image# | |
skopeo copy --src-tls-verify=false --dest-tls-verify=false docker://docker-registry-default.apps.oldocp.com/openshift/fuse7-console:1.3 docker://docker-registry-default.apps.newocp.com/openshift/fuse7-console:1.3 | |
#Check Deployment# | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment