You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
EXEC: paste the following in an editor for a yaml file:
# --------------------------# PersistentVolume 2 (targeted by PVC with matchExpressions)# --------------------------apiVersion: v1kind: PersistentVolumemetadata:
name: pv-expressionslabels:
environment: production # Label for matchExpressionsregion: us-west # Label for matchExpressions (key existence)spec:
capacity:
storage: 10GiaccessModes:
- ReadWriteOncestorageClassName: manual # Disables dynamic provisioninghostPath:
path: /mnt/data-expressions
---
# --------------------------# PVC 2: Uses matchExpressions# --------------------------apiVersion: v1kind: PersistentVolumeClaimmetadata:
name: pvc-expressionsspec:
storageClassName: manualaccessModes:
- ReadWriteOnceresources:
requests:
storage: 10Giselector:
matchExpressions:
- key: environmentoperator: In # Value must be in the listvalues: [production, staging]
- key: regionoperator: Exists # Key must exist (value ignored)
EXEC: go to the selector in the PVC and verify that it is matching the PV
Result:
The PVC reports "0 matching" for it's selector even though it's expression
matchExpressions:
- key: environmentoperator: In # Value must be in the listvalues: [production, staging]
- key: regionoperator: Exists # Key must exist (value ignored)
is matching the labels in the PV:
labels:
environment: production # Label for matchExpressionsregion: us-west # Label for matchExpressions (key existence)
The text was updated successfully, but these errors were encountered:
adietish
changed the title
PVC with matchExpressions is NOT matching PV with labels that match the expression
editor: PVC with matchExpressions is NOT matching PV with labels that match the expression
May 16, 2025
follows up on #642
Steps:
Result:
The PVC reports "0 matching" for it's selector even though it's expression
is matching the labels in the PV:
The text was updated successfully, but these errors were encountered: