title: Kubernetes: 2 PVCs in 2 namespaces binding to the same PV, one successful, one failed
body: <p>So I have 2 PVCs in 2 namespaces binding to 1 PV:</p>
  <p>The following are the PVCs:</p>
  <pre><code>apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc-git
    namespace: mlo-dev
    labels:
      type: local
  spec:
    storageClassName: mlo-git
    volumeMode: Filesystem
    accessModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 1Gi
  ---
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pvc-git
    namespace: mlo-stage
    labels:
      type: local
  spec:
    storageClassName: mlo-git
    volumeMode: Filesystem
    accessModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 1Gi
  </code></pre>
  <p>and the PV:</p>
  <pre><code>kind: PersistentVolume
  apiVersion: v1
  metadata:
    name: pv-git
    labels:
      type: local
  spec:
    storageClassName: mlo-git
    capacity:
      storage: 1Gi
    volumeMode: Filesystem
    accessModes:
      - ReadWriteMany
    hostPath:
      path: /git
  </code></pre>
  <p>in the namespace &quot;mlo-dev&quot;, the binding is successful:</p>
  <pre><code>$ kubectl describe pvc pvc-git -n mlo-dev
  Name:          pvc-git
  Namespace:     mlo-dev
  StorageClass:  mlo-git
  Status:        Bound
  Volume:        pv-git
  Labels:        type=local
  Annotations:   pv.kubernetes.io/bind-completed: yes
                 pv.kubernetes.io/bound-by-controller: yes
  Finalizers:    [kubernetes.io/pvc-protection]
  Capacity:      1Gi
  Access Modes:  RWX
  VolumeMode:    Filesystem
  Mounted By:    
  ...
  various different pods here...
  ...
  Events:        &lt;none&gt;
  </code></pre>
  <p>Whereas in the namespace &quot;mlo-stage&quot;, the binding is failed with the error message: storageclass.storage.k8s.io &quot;mlo-git&quot; not found</p>
  <pre><code>$ kubectl describe pvc pvc-git -n mlo-stage
  Name:          pvc-git
  Namespace:     mlo-stage
  StorageClass:  mlo-git
  Status:        Pending
  Volume:        
  Labels:        type=local
  Annotations:   Finalizers:  [kubernetes.io/pvc-protection]
  Capacity:      
  Access Modes:  
  VolumeMode:    Filesystem
  Mounted By: 
  ...
  various different pods here...
  ...
  Events:
    Type     Reason              Age                   From                         Message
    ----     ------              ----                  ----                         -------
    Warning  ProvisioningFailed  3m4s (x302 over 78m)  persistentvolume-controller  storageclass.storage.k8s.io &quot;mlo-git&quot; not found
  </code></pre>
  <p>As I know, PV is not scoped to namespace, so it should be possible for PVCs in different namespaces to bind to the same PV?</p>
  <p>+++++
  Added:
  +++++</p>
  <p>when &quot;kubectl describe pv pv-git&quot;, I got the following:</p>
  <pre><code>$ kubectl describe pv pv-git
  Name:            pv-git
  Labels:          type=local
  Annotations:     pv.kubernetes.io/bound-by-controller: yes
  Finalizers:      [kubernetes.io/pv-protection]
  StorageClass:    mlo-git
  Status:          Bound
  Claim:           mlo-dev/pvc-git
  Reclaim Policy:  Retain
  Access Modes:    RWX
  VolumeMode:      Filesystem
  Capacity:        1Gi
  Node Affinity:   &lt;none&gt;
  Message:         
  Source:
      Type:          HostPath (bare host directory volume)
      Path:          /git
      HostPathType:  
  Events:            &lt;none&gt;
  </code></pre>