Skip to content

Support for fsType parameter (XFS in particular) #617

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WojciechKarpiel opened this issue Sep 25, 2020 · 5 comments
Closed

Support for fsType parameter (XFS in particular) #617

WojciechKarpiel opened this issue Sep 25, 2020 · 5 comments
Assignees

Comments

@WojciechKarpiel
Copy link

Hello!
My use case is: use Volume Snapshots for creating backups for MongoDB
My problem is: I am not able to use the CSI driver to provision PV using following StorageClass:

$ k get storageclass/ssd-xfs -o yaml
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    meta.helm.sh/release-name: mongo
    meta.helm.sh/release-namespace: pv-snapshot-test
  creationTimestamp: "2020-09-25T06:52:24Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: ssd-xfs
  resourceVersion: "1705891"
  selfLink: /apis/storage.k8s.io/v1/storageclasses/ssd-xfs
  uid: a4f1566f-3488-4f2e-a319-34a33d748338
parameters:
  fsType: xfs # if this line is removed, then it works fine
  type: pd-ssd
provisioner: pd.csi.storage.gke.io # with kubernetes.io/gce-pd it works fine
reclaimPolicy: Retain
volumeBindingMode: Immediate

Note the fsType: xfs part. If I remove this line, then PV is created correctly (ext4 is assumed).
I want to use XFS because it's recommended for MongoDB: https://docs.mongodb.com/manual/administration/production-notes/#kernel-and-file-systems
Until now, I used kubernetes.io/gce-pd provisioner, but the kubernetes.io/gce-pd provisioner doesn't support VolumeSnapshots.

Here's error that I'm getting:

$ k describe pvc/mongo-mongod-persistent-storage-claim-mongo-mongod-0
Name:          mongo-mongod-persistent-storage-claim-mongo-mongod-0
Namespace:     pv-snapshot-test
StorageClass:  ssd-xfs
Status:        Pending
Volume:        
Labels:        namespace=pv-snapshot-test
               release=mongo
               replicaset=pv-snapshot-test
               role=mongo-mongod
Annotations:   volume.beta.kubernetes.io/storage-provisioner: pd.csi.storage.gke.io
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Mounted By:    mongo-mongod-0
Events:
  Type     Reason                Age               From                                                                                              Message
  ----     ------                ----              ----                                                                                              -------
  Normal   ExternalProvisioning  9s (x3 over 14s)  persistentvolume-controller                                                                       waiting for a volume to be created, either by external provisioner "pd.csi.storage.gke.io" or manually created by system administrator
  Normal   Provisioning          1s (x5 over 14s)  pd.csi.storage.gke.io_gke-94d5a50d657f33493eee-4949-d2f1-vm_e50598b5-0cc8-43e2-814c-8973442fbef3  External provisioner is provisioning volume for claim "pv-snapshot-test/mongo-mongod-persistent-storage-claim-mongo-mongod-0"
  Warning  ProvisioningFailed    1s (x5 over 14s)  pd.csi.storage.gke.io_gke-94d5a50d657f33493eee-4949-d2f1-vm_e50598b5-0cc8-43e2-814c-8973442fbef3  failed to provision volume with StorageClass "ssd-xfs": rpc error: code = InvalidArgument desc = failed to extract parameters: parameters contains invalid option "fsType"

For completeness, here's PVC's yaml:

k get pvc/mongo-mongod-persistent-storage-claim-mongo-mongod-0 -o yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    volume.beta.kubernetes.io/storage-provisioner: pd.csi.storage.gke.io
  creationTimestamp: "2020-09-25T06:52:24Z"
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    namespace: pv-snapshot-test
    release: mongo
    replicaset: pv-snapshot-test
    role: mongo-mongod
  name: mongo-mongod-persistent-storage-claim-mongo-mongod-0
  namespace: pv-snapshot-test
  resourceVersion: "1705902"
  selfLink: /api/v1/namespaces/pv-snapshot-test/persistentvolumeclaims/mongo-mongod-persistent-storage-claim-mongo-mongod-0
  uid: a01c49d0-3322-46ac-abe6-52f3ae2c71e8
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: ssd-xfs
  volumeMode: Filesystem
status:
  phase: Pending
@msau42
Copy link
Contributor

msau42 commented Sep 25, 2020

For CSI, the correct storageclass parameter is "csi.storage.k8s.io/fstype: xfs". Can you try that?

/assign @mattcary
to add to docs + example

@WojciechKarpiel
Copy link
Author

Works like a charm, thanks!

@mattcary
Copy link
Contributor

Fixed in #582

@mattcary
Copy link
Contributor

/close

@k8s-ci-robot
Copy link
Contributor

@mattcary: Closing this issue.

In response to this:

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants