-
Notifications
You must be signed in to change notification settings - Fork 518
Description
Use case is as follows:
I have X nodes, some have ssd other hdd, created two storage classes fastStorage and slowStorage.
Also created nodeLabes haveSsd / haveHdd.
Currently I could manually configure every node in local path provisioner config to only have a path available that corresponds to the right storage class.
So how this would then work (to my current understanding) is
- k8s selects a node
- lpp cant find matching path definition for storage class and removes selected-node-annotation
- k8s selects another node
- ipp finally can provision
Ok workflow seems weird but ok, only problem is for this to work I would have to define storage class relations for every node manually in the lpp config. And the nodeLabes are useless.
So I looked into the code and to my understanding its all already there within 5 lines of code to make this work better?
Inside provisionClaimOperation around "reschedule and remove volume.kubernetes.io/selected-node annotation" is everything in order to process node labels?
Suggestion
One could add StorageClass.parameters.mustHaveNodeLabel = haveSsd.
And then the provisioner would just have to check if mustHaveNodeLabel is set and selectedNode.metadata.labels contains claim.storageClass.parameters.mustHaveNodeLabel right after selectedNode has been defied. If there is no match it would then do the same as on error below, remove selected-node annotation.
I was about to create a PR but my go knowledge is basically nonexistent, also I have no idea how to toolchain a test.