hpe-storage / truenas-csp

TrueNAS Container Storage Provider for HPE CSI Driver for Kubernetes
https://scod.hpedev.io
MIT License
65 stars 8 forks source link

Unable to provision non-sparse volumes #49

Closed santimar closed 4 months ago

santimar commented 9 months ago

I followed the tutorial on INSTALL.md and installed the provider via helm.

At the last step I'm creating the storage class like this:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
  name: hpe-storageclass
provisioner: csi.hpe.com
parameters:
  csi.storage.k8s.io/controller-expand-secret-name: truenas-secret
  csi.storage.k8s.io/controller-expand-secret-namespace: hpe-storage
  csi.storage.k8s.io/controller-publish-secret-name: truenas-secret
  csi.storage.k8s.io/controller-publish-secret-namespace: hpe-storage
  csi.storage.k8s.io/node-publish-secret-name: truenas-secret
  csi.storage.k8s.io/node-publish-secret-namespace: hpe-storage
  csi.storage.k8s.io/node-stage-secret-name: truenas-secret
  csi.storage.k8s.io/node-stage-secret-namespace: hpe-storage
  csi.storage.k8s.io/provisioner-secret-name: truenas-secret
  csi.storage.k8s.io/provisioner-secret-namespace: hpe-storage
  csi.storage.k8s.io/fstype: xfs
  allowOverrides: compression,deduplication,volblocksize,sync
  root: pool1/mypool
  sparse: 'false'
  description: my custom description
reclaimPolicy: Delete
allowVolumeExpansion: true

The SC should create non sparse volumes by default.

I then create a PVC with the SC

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-pvc
  namespace: default
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: hpe-storageclass
  resources:
    requests:
      storage: 10Gi

The PV is created, but on TrueNAS UI i see Provisioning Type: Sparse instead of Provisioning Type: Thick image

Am I missing something?

datamattsson commented 9 months ago

Hey! Thanks for reporting this. I took a look and we're doing some assumptions and this is a bug. I wonder what results you get when you set sparse: 0 in the StorageClass?

santimar commented 9 months ago

I see no difference with sparse: 0, volume is provisioned with Provisioning Type: Sparse

datamattsson commented 9 months ago

Ok, thanks for checking.

datamattsson commented 4 months ago

This has been fixed in v2.4.2. Set .parameters.sparse: "false".