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

Already on GitHub? Sign in to your account

add xfsprogs to add mkfs.xfs binary to csi-linode-node pod #199

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

rahulait
Copy link
Contributor

@rahulait rahulait commented Aug 16, 2024

General:

  • Have you removed all sensitive information, including but not limited to access keys and passwords?
  • Have you checked to ensure there aren't other open or closed Pull Requests for the same bug/feature/question?

There was a long standing request to support xfs filesystem within PVCs provisioned by linode-csi-driver: https://www.linode.com/community/questions/20316/create-a-persistentvolume-on-lke-with-a-different-fstype

One of the dependencies were resolved recently which added volumemode=block support: #126

However, when provisioning pvcs with fstype as xfs, it was still failing as the mkfs.xfs binary was missing from the pods.

This PR adds this binary so that one can provision PVCs with filesystem of type xfs. Here is the output from csi-linode-plugin container of csi-linode-node pod before and after adding the binary.

Before:

/ # ls /sbin/mkfs*
/sbin/mkfs.ext2  /sbin/mkfs.ext3  /sbin/mkfs.ext4  /sbin/mkfs.vfat

After:

/ # ls /sbin/mkfs*
/sbin/mkfs.ext2  /sbin/mkfs.ext3  /sbin/mkfs.ext4  /sbin/mkfs.vfat  /sbin/mkfs.xfs

Here is a sample yaml one can use to test it out with this branch:

---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: linode-block-storage-retain-xfs
parameters:
    fstype: xfs
provisioner: linodebs.csi.linode.com
reclaimPolicy: Retain
volumeBindingMode: Immediate
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: csi-example-pod
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: csi-example-pod
  replicas: 1
  template:
    metadata:
      labels:
        app: csi-example-pod
    spec:
      containers:
      - name: csi-example-pod
        image: busybox
        volumeMounts:
        - mountPath: "/data"
          name: csi-example-volume
        command: [ "sleep", "1000000" ]
      volumes:
      - name: csi-example-volume
        persistentVolumeClaim:
          claimName: csi-example-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: csi-example-pvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: linode-block-storage-retain-xfs

Pull Request Guidelines:

  1. Does your submission pass tests?
  2. Have you added tests?
  3. Are you addressing a single feature in this PR?
  4. Are your commits atomic, addressing one change per commit?
  5. Are you following the conventions of the language?
  6. Have you saved your large formatting changes for a different PR, so we can focus on your work?
  7. Have you explained your rationale for why this feature is needed?
  8. Have you linked your PR to an open issue

@rahulait rahulait requested review from a team as code owners August 16, 2024 16:15
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.40%. Comparing base (e5a7c33) to head (d760709).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #199   +/-   ##
=======================================
  Coverage   36.40%   36.40%           
=======================================
  Files          22       22           
  Lines        1596     1596           
=======================================
  Hits          581      581           
  Misses        981      981           
  Partials       34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rahulait rahulait force-pushed the add-xfs-binary branch 3 times, most recently from 948eb2a to cdb5e34 Compare August 16, 2024 18:48
@rahulait rahulait force-pushed the add-xfs-binary branch 2 times, most recently from e8ff6b4 to 2a705c2 Compare August 16, 2024 19:38
Copy link
Contributor

@komer3 komer3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LTGM!

@rahulait rahulait merged commit 4ff8037 into main Aug 19, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants