美文网首页从容器到kubernetes
pv和pvc的创建及挂载

pv和pvc的创建及挂载

作者: 大鹏一怒乘风起 | 来源:发表于2021-10-29 19:04 被阅读0次

    PV 可以跨namespace 访问
    但是PVC必须在相应的namespace

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: test
      labels:
        name: test
    spec:
      nfs:
        path: /data/nfsdata
        server: 10.1.1.240
      capacity:
        storage: 5Gi
      accessModes:
        - ReadWriteOnce
        - ReadWriteMany
    ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: test
      namespace: xxxprod
    spec:
      accessModes: ["ReadWriteMany"]
      resources:
        requests:
          storage: 5Gi
      selector:
        matchLabels:
          name: test
    

    相关文章

      网友评论

        本文标题:pv和pvc的创建及挂载

        本文链接:https://www.haomeiwen.com/subject/bcfwaltx.html