Preparing Object Storage and Velero

O&M or development personnel migrate Kubernetes objects using the Velero tool.

Preparing Object Storage MinIO

MinIO official website: https://docs.min.io/

Prepare the object storage and save its AK/SK.

  1. Install the MinIO.

    MinIO is a high performance,distributed,Kubernetes Native Object Storage.

    # Binary installation
    mkdir /opt/minio 
    mkdir /opt/miniodata 
    cd /opt/minio 
    wget https://dl.minio.io/server/minio/release/linux-amd64/minio 
    chmod +x minio 
    export MINIO_ACCESS_KEY=minio 
    export MINIO_SECRET_KEY=minio123 
    ./minio server /opt/miniodata/ & 
    Enter http://{EIP of the node where MinIO is deployed}:9000 in the address box of a browser. Note that the corresponding ports on the firewall and security group must be enabled.
    
    # Installing kubectl in containers
    # To release the MinIO service as a service that can be accessed from outside the cluster, change the service type in 00-minio-deployment.yaml to NodePort or LoadBalancer.
    kubectl apply -f ./velero-v1.4.0-linux-amd64/examples/minio/00-minio-deployment.yaml

  2. Create a bucket, which will be used in the migration.

    Open the web page of the MinIO service.
    Use MINIO_ACCESS_KEY/MINIO_SECRET_KEY to log in to the MinIO service. In this example, use minio/minio123.
    Click Create bucket above +. In this example, create a bucket named velero.

Preparing Velero

Velero official website: https://velero.io/docs/v1.4/contributions/minio/

Velero is an open source tool to safely back up, restore, perform disaster recovery, and migrate Kubernetes cluster resources and persistent volumes.

Perform the following operations on the ACK and CCE nodes that can run kubectl commands:

  1. Download the migration tool Velero.

    Download the latest stable version from https://github.com/heptio/velero/releases.
    This document uses velero-v1.4.0-linux-amd64.tar.gz as an example.

  2. Install the Velero client.

    mkdir /opt/ack2cce 
    cd /opt/ack2cce 
    tar -xvf velero-v1.4.0-linux-amd64.tar.gz -C /opt/ack2cce 
    cp /opt/ack2cce/velero-v1.4.0-linux-amd64/velero /usr/local/bin

  3. Install the Velero server.

    cd /opt/ack2cce 
    # Prepare the MinIO authentication file. The AK/SK must be correct.
    vi credentials-velero  
    
    [default]    
    aws_access_key_id = minio 
    aws_secret_access_key = minio123  
    
    # Install the Velero server. Note that s3Url must be set to the correct MinIO address.
    velero install \ 
     --provider aws \ 
     --plugins velero/velero-plugin-for-aws:v1.0.0 \ 
     --bucket velero \ 
     --secret-file ./credentials-velero \ 
     --use-restic \ 
     --use-volume-snapshots=false \ 
     --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://{EIP of the node where minio runs}:9000