• Velero-K8S集群备份和恢复


    一、Minio

    minio是velero所需的存储类型。

    1、分布式部署

    接上一篇Minio分布式部署

    2、单机部署如下:

    2.1、安装配置

    通过docker配置:

    docker run -d -p 9000:9000 --name minio1 -v /data/k8s/minio:/data minio/minio server /data
    

    运行完成后配置nginx访问即可。

    2.2、基本操作

    minio client:

    # 下载minio client
    docker pull minio/mc
    # 配置minio
    mc config host add s3 http://minio.sunnydou.com <username> <passwd>
    # list仓库
    mc ls velero-devgroup
    # 删除指定目录超过30d的文件
    mc rm --recursive --force --older-than 30d s3/velero-bucket/restores/
    

    二、Velero

    1、安装配置

    安装方式:Velero cli install

    velero install --image velero/velero:v1.3.1 
                   --provider aws  
                   --bucket devbase  
                   --namespace velero 
                   --secret-file ./credentials-velero 
                   --velero-pod-cpu-request 200m 
                   --velero-pod-mem-request 200Mi 
                   --velero-pod-cpu-limit 1000m 
                   --velero-pod-mem-limit 1000Mi 
                   --use-volume-snapshots=false 
                   --use-restic 
                   --restic-pod-cpu-request 200m 
                   --restic-pod-mem-request 200Mi 
                   --restic-pod-cpu-limit 1000m 
                   --restic-pod-mem-limit 1000Mi 
                   --plugins velero/velero-plugin-for-aws:v1.0.0 
                   --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://minio.sunnydou.com
    
    # secret 文件格式如下               
    [default]
    aws_access_key_id = <username>
    aws_secret_access_key = <passwd>
    

    2、备份

    2.1、定时备份

    velero create schedule devbase-daily-backup --schedule="0 20 * * *" 
                                                --ttl 2160h0m0s 
                                                --include-namespaces default,b0 
                                                --storage-location default
    

    2.2、手动备份

    # The default TTL is 30 days (720 hours); you can use the --ttl flag to change this as necessary.
    velero backup create <BACKUP-NAME>
    

    2.3、恢复

    velero restore create --from-backup <backup-name>
    

    2.4、添加存储空间

    velero backup-location create <backupname> --access-mode=ReadOnly --bucket=velero-bucket --provider=aws --config region=minio,s3ForcePathStyle="true",s3Url=http://minio_url
    

    附录

    官网文档:集群迁移

    本文来自博客园,作者:sunnydoy,转载请注明原文链接:https://www.cnblogs.com/sunnydou/p/15139331.html

  • 相关阅读:
    切割栅格数据 切割raster
    缓存讲解
    Arcengine动态发布WMS
    dos命令
    在遥感影像中,立体相对观测的原理是什么?
    Top 10 steps to optimize data access in SQL Server: Part V (Optimize database files and apply partitioning)
    http://blog.csdn.net/itanders
    How to receive Deadlock information automatically via email
    减负
    Provisioning a New SQL Server Instance Series
  • 原文地址:https://www.cnblogs.com/sunnydou/p/15139331.html
Copyright © 2020-2023  润新知