i created a pv in default namespace
Next i created a new pvc in another namespace named green-tiger
.
pvc yaml:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
namespace: green-tiger
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
and pv.yaml:
apiVersion: v1
kind: PersistentVolume
metadata:
name: my-pv
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/Volumes/Data"
as u can see there is no selector that pvc can bind, but somehow right after pvc created, the status is ‘bound’.
pv and pvc are properly bound. why? since there is no matchLabels or selector field specified anywhere. why does it bind immediately?