我能否从namespace-B引用位于namespace-A中的PVC?为什么需要这样做呢?我想允许客户(私有云)通过PVC指定他们的卷,以便完全控制存储。在安装Helm时会要求提供PVC信息,并在pod规范中使用它。
我能否从namespace-B引用位于namespace-A中的PVC?为什么需要这样做呢?我想允许客户(私有云)通过PVC指定他们的卷,以便完全控制存储。在安装Helm时会要求提供PVC信息,并在pod规范中使用它。
这看起来似乎不可能,因为PersistentVolumeClaim
是一个命名空间对象。您可以在此处查看详细答案:https://dev59.com/iFsW5IYBdhLWcg3wHUOb#35366775
以防有人从谷歌到这里:现在可以使用 Kubernetes 1.26(Alpha版)实现跨命名空间数据源:https://kubernetes.io/docs/concepts/storage/persistent-volumes/#cross-namespace-data-sources
pvc-shared-namespaces: NS1, NS2
pvc-ref: pvc-1 # the name of the source PVC
pvc-ref-namespace: pvc-1-ns # the namespace of the source PVC
pvc-shared-namespaces
的任何信息,甚至在谷歌上也没有。 - BeGreen
name:
属性的新文件中,并在您的新 pvc 中引用该卷。 - Daniel Quinn