Hi all, quick question, is there an example of a S...
# harvester
h
Hi all, quick question, is there an example of a StorageClass that includes the cdi.harvesterhci.io/storageProfileAccessModes annotation? I'm testing our CSI driver on a harvester environment and for one of our storage protocols (not supported in the CDI version harvester uses) and I get that error when trying to create the StorageClass. thx
b
I don't think I've ever added the annotations.
We only use ceph rbd devices with Harvester (as data not boot volumes) and I don't think it needed one to use in Harvester.
Copy code
allowVolumeExpansion: true
apiVersion: <http://storage.k8s.io/v1|storage.k8s.io/v1>
kind: StorageClass
metadata:
  annotations:
    <http://objectset.rio.cattle.io/applied|objectset.rio.cattle.io/applied>: >-
      <thing>
    <http://objectset.rio.cattle.io/id|objectset.rio.cattle.io/id>: <thing>
  creationTimestamp: '2025-02-04T17:39:47Z'
  labels:
    <http://objectset.rio.cattle.io/hash|objectset.rio.cattle.io/hash>: <thing>
  managedFields:
    - apiVersion: <http://storage.k8s.io/v1|storage.k8s.io/v1>
      fieldsType: FieldsV1
      fieldsV1:
        f:allowVolumeExpansion: {}
        f:metadata:
          f:annotations:
            .: {}
            f:<http://objectset.rio.cattle.io/applied|objectset.rio.cattle.io/applied>: {}
            f:<http://objectset.rio.cattle.io/id|objectset.rio.cattle.io/id>: {}
          f:labels:
            .: {}
            f:<http://objectset.rio.cattle.io/hash|objectset.rio.cattle.io/hash>: {}
        f:mountOptions: {}
        f:parameters:
          .: {}
          f:clusterID: {}
          f:<http://csi.storage.k8s.io/controller-expand-secret-name|csi.storage.k8s.io/controller-expand-secret-name>: {}
          f:<http://csi.storage.k8s.io/controller-expand-secret-namespace|csi.storage.k8s.io/controller-expand-secret-namespace>: {}
          f:<http://csi.storage.k8s.io/node-stage-secret-name|csi.storage.k8s.io/node-stage-secret-name>: {}
          f:<http://csi.storage.k8s.io/node-stage-secret-namespace|csi.storage.k8s.io/node-stage-secret-namespace>: {}
          f:<http://csi.storage.k8s.io/provisioner-secret-name|csi.storage.k8s.io/provisioner-secret-name>: {}
          f:<http://csi.storage.k8s.io/provisioner-secret-namespace|csi.storage.k8s.io/provisioner-secret-namespace>: {}
          f:imageFeatures: {}
          f:pool: {}
        f:provisioner: {}
        f:reclaimPolicy: {}
        f:volumeBindingMode: {}
      manager: rancher
      operation: Update
      time: '2025-02-04T17:39:47Z'
  name: csi-rbd-sc
  resourceVersion: '<thing>'
  uid: <thing>
mountOptions:
  - discard
parameters:
  clusterID: <ID>
  <http://csi.storage.k8s.io/controller-expand-secret-name|csi.storage.k8s.io/controller-expand-secret-name>: csi-rbd-secret
  <http://csi.storage.k8s.io/controller-expand-secret-namespace|csi.storage.k8s.io/controller-expand-secret-namespace>: default
  <http://csi.storage.k8s.io/node-stage-secret-name|csi.storage.k8s.io/node-stage-secret-name>: csi-rbd-secret
  <http://csi.storage.k8s.io/node-stage-secret-namespace|csi.storage.k8s.io/node-stage-secret-namespace>: default
  <http://csi.storage.k8s.io/provisioner-secret-name|csi.storage.k8s.io/provisioner-secret-name>: csi-rbd-secret
  <http://csi.storage.k8s.io/provisioner-secret-namespace|csi.storage.k8s.io/provisioner-secret-namespace>: default
  imageFeatures: layering
  pool: devharvester
provisioner: <http://rbd.csi.ceph.com|rbd.csi.ceph.com>
reclaimPolicy: Retain
volumeBindingMode: Immediate
Hmmm. I might be a little confused, or maybe you're missing part of the puzzle? I'm looking at the StorageProfile (Which is it's own kube object from upstream kubevirt and not part of a harvester annotation) and it looks like it has
accessModes
as part of the spec. Ie:
.spec.claimPropertySets.accessModes
I didn't see any requirements in the harvester docs for
.metadata.annotations
I think the idea for these Storage Profiles is that you might have something that support multiple access modes, but in the profile you want it to have a smaller list or different defaults. Either way, I think you should be able to set up the StorageClass object without/before the StorageProfile.
and I get that error when trying to create the StorageClass.
But maybe you can post some of the yaml you're using to create the sc, and the actual error you're getting?
p
1.6 started requiring it I think. I'm doing like
apiVersion: <http://storage.k8s.io/v1|storage.k8s.io/v1>
kind: StorageClass
metadata:
annotations:
<http://cdi.harvesterhci.io/storageProfileVolumeModeAccessModes|cdi.harvesterhci.io/storageProfileVolumeModeAccessModes>: |
{"Block":["ReadWriteOnce","ReadOnlyMany"],"Filesystem":["ReadWriteOnce","ReadWriteMany"]}
...
h
perfect! thanks, would be great to add that to the Harvester docs where it mentions the annotation: https://docs.harvesterhci.io/v1.6/advanced/csidriver
if I can find that in the docs, I'll submit a PR.
and I didn't see that reference, it is already documented it would appear, I just missed finding it.
thanks for helping me with this, I've validated our CSI driver works with Harvester! we'll announce our support with our v2.24.0 upcoming release.
🫡 1