• OpenShift nfs 持久化


    创建PV

    {
        "apiVersion": "v1",
        "kind": "PersistentVolume",
        "metadata": {
            "name": "pv0001"
        },
        "spec": {
            "capacity": {
                "storage": "100Gi"
            },
            "accessModes": [
                "ReadWriteOnce"
            ],
            "nfs": {
                "path": "/volume1/server/oc",
                "server": "192.168.4.245"
            },
            "persistentVolumeReclaimPolicy": "Retain"
        }
    }

    # oc create -f pv.json

    {
        "apiVersion": "v1",
        "kind": "PersistentVolumeClaim",
        "metadata": {
            "name": "docker-registry-claim"
        },
        "spec": {
            "accessModes": [
                "ReadWriteOnce"
            ],
            "resources": {
                "requests": {
                    "storage": "5Gi"
                }
            }
        }
    }

    # oc create -f pvc.json

    docker-registry 仓库持久化案例

    [root@master ~]# oc project default 
    Already on project "default" on server "https://master:8443".

    查看现有数据大小

    [root@master ~]# oc rsh docker-registry-7-w19hb 'du' '-sh' '/registry'
    568 M    /registry

    备份数据

    [root@master ~]# mount -t nfs 192.168.4.245:/volume1/server/oc /mnt/
    [root@master ~]# cd /mnt/
    [root@master mnt]# oc rsync docker-registry-7-w19hb:/registry .

    关联数据卷

    [root@master ~]# oc volume dc/docker-registry --remove --name=registry-storage -t pvc --claim-name=docker-registry-claim --overwrite deploymentconfigs/docker-registry

    #触发生效

    [root@master mnt]# oc delete pod docker-registry-7-w19hb
  • 相关阅读:
    从键盘输入10个数,计算出正数和负数的个数。
    浏览器允许的并发请求资源数 优化
    strict 严格模式
    AMD 和 CMD 的区别
    Canvas
    visual filters 滤镜 ie
    ie 如何判断正在执行的脚本
    async
    富文本编辑器
    检测CSS属性 是否支持
  • 原文地址:https://www.cnblogs.com/37yan/p/7833190.html
Copyright © 2020-2023  润新知