Bug 1717746
| Summary: | selector-label volume binding is not working | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Jaspreet Kaur <jkaur> |
| Component: | Storage | Assignee: | Jan Safranek <jsafrane> |
| Status: | CLOSED NOTABUG | QA Contact: | Liang Xia <lxia> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.11.0 | CC: | aos-bugs, aos-storage-staff, jsafrane |
| Target Milestone: | --- | ||
| Target Release: | 3.11.z | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-07-11 08:31:38 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jaspreet Kaur
2019-06-06 05:18:18 UTC
If I understand the report correctly, your PV got bound to a "random" PVC, while you expected that it binds only to a PVC that specifies the selector?
I am afraid it's not how selectors work. Using a selector, a PVC can require PV with specific labels. But a PVC without any selector matches *any* PV, i.e. your "postgresql" PVC matched your PV.
To reserve a PV for specific tasks, you have two options:
1) Create specific storage class for the PV. If necessary (in multi tenant env), use quota to "reserve" the storage class (and thus the PV(s)) only to specific namespace.
2) Or, if you know the PVC namespace + name, you can "pre-bind" the PV to your PVC. Such PV will bind only to given PVC and to nothing else:
apiVersion: v1
kind: PersistentVolume
metadata:
name: mktg-ops--kafka--kafka-broker01
spec:
capacity:
storage: 15Gi
accessModes:
- ReadWriteOnce
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: kafka-broker01
namespace: default
iscsi:
...
Does it solve your issue?
I explained how PV binding and selector works, the observed behavior is expected. The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days |