Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Storage Class Configuration Not Applied to PV When Created via Web UI #6802

Open
roger-ryao opened this issue Sep 27, 2023 · 2 comments
Labels
kind/bug reproduce/always 100% reproducible require/backport Require backport. Only used when the specific versions to backport have not been definied. require/qa-review-coverage Require QA to review coverage
Milestone

Comments

@roger-ryao
Copy link

Describe the bug (馃悰 if you encounter this issue)

When I verified issue #6655, I created the storage class longhorn-test using a manifest. Then, I created a volume, PV, and PVC through the Web UI, specifying the Storage Class Name as longhorn-test. However, when I checked the PV YAML output, I couldn't find the longhorn-test configuration applied to the PV.

To Reproduce

  1. Created a StorageClass named longhorn-test using a manifest file.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: longhorn-test
provisioner: driver.longhorn.io
allowVolumeExpansion: true
reclaimPolicy: Delete
volumeBindingMode: Immediate
parameters:
  numberOfReplicas: "3"
  staleReplicaTimeout: "2880"
  fromBackup: ""
  fsType: "ext4"
  nfsOptions: "hard,timeo=50,retrans=1"
  1. Using the Longhorn Web UI, I created a volume and than created volume's PV/PVC, specifying the storageClassName as longhorn-test.
  2. However, when I checked the YAML output of the PV, I observed that the configuration related to longhorn-test was not applied to the PV.
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    longhorn.io/volume-scheduling-error: ""
    pv.kubernetes.io/bound-by-controller: "yes"
  creationTimestamp: "2023-09-27T09:31:42Z"
  finalizers:
  - kubernetes.io/pv-protection
  name: vol-6
  resourceVersion: "25956"
  uid: f92c525e-3bce-44e0-a15f-0e33cba90af3
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 2Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: vol-6
    namespace: default
    resourceVersion: "25954"
    uid: 4a8c6d4e-88ac-48a8-80c3-396ac878568a
  csi:
    driver: driver.longhorn.io
    fsType: ext4
    volumeAttributes:
      diskSelector: ""
      nodeSelector: ""
      numberOfReplicas: "3"
      staleReplicaTimeout: "20"
    volumeHandle: vol-6
  persistentVolumeReclaimPolicy: Retain
  storageClassName: longhorn-test
  volumeMode: Filesystem
status:
  phase: Bound

Expected behavior

When user create a volume through the Longhorn WebUI and specify a storageClassName as longhorn-test for the PVC/ PV should also reflect the same storageClassName configuration.

Support bundle for troubleshooting

supportbundle_d76ea023-2256-41d3-98da-c263bd3fad4e_2023-09-27T09-46-58Z.zip

Additional context

#6655
#3506

@roger-ryao roger-ryao added kind/bug reproduce/always 100% reproducible require/qa-review-coverage Require QA to review coverage require/backport Require backport. Only used when the specific versions to backport have not been definied. labels Sep 27, 2023
@roger-ryao roger-ryao added this to the v1.6.0 milestone Sep 27, 2023
@m-ildefons
Copy link

Hi Roger,
I'm not sure there is a bug here. When you create a volume and then a PV and PVC for that volume, you do static volume provisioning. In that case, the storage class name must match between the PV and PVC, so K8s can bind the two, but otherwise the storage class is ignored, since the volume is already created and the parameters can't necessarily be changed anymore. You could even set the storage class name to "" in this case.
Only if you create the PVC first and let the CSI driver handle the PV and volume, the settings from the storage class will be applied. This is then called dynamic provisioning.

@yangchiu
Copy link
Member

yangchiu commented Dec 7, 2023

With #3506 (comment) and #6802 (comment). Does it mean the Storage Class Name filed on the UI is only applicable when restore a volume from backup? @ChanYiLin

@innobead innobead modified the milestones: v1.6.0, Backlog Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug reproduce/always 100% reproducible require/backport Require backport. Only used when the specific versions to backport have not been definied. require/qa-review-coverage Require QA to review coverage
Projects
None yet
Development

No branches or pull requests

4 participants