This message was deleted.
# longhorn-storage
a
This message was deleted.
c
You’re supposed to do it in the storageclass, if you want volumes created in that storageclass to require labels by default https://longhorn.io/docs/1.7.2/nodes-and-volumes/nodes/storage-tags/#kubernetes
q
are you talking about this param:
<http://storageclass.kubernetes.io/is-default-class|storageclass.kubernetes.io/is-default-class>: "true"
c
what?
no, the nodeSelector bit
that is just the annotation that sets the default storageclass for the cluster
q
sorry, i got that part, my issues is more like this: a better prompt for the question thanks to someone in the #C01GKHKAG0K channel: is there a way to prevent Longhorn replicas from being added to a disk with a disk label unless there's a matching label
i posted a follow up probably when you wrote your response.
c
label everything, use the storageclass to set nodeSelector/diskSelector to put it where you want
q
my issue is that i have about 100 volumes, that are assigned to a sc that has no labels (in harvester). now i added a couple disks i only want a specific service on (database iops basically) so i spun up the disks, setup the sc and labels, but volumes that have no labels periodically get placed on those disks. does that make sense?
c
you should be able to label the existing disks and add a diskSelector to the storageclass
q
i'll check for some reason i didnt think you could
c
and then put different labels and create a new sc for the high iops disks
my understanding is that it’s an opt-in - you can say, require these labels on disks or nodes for this SC. You can’t say, DONT allow these disks to be used by any other SC.
q
yeah, that's what i was finding. seems like you cant set node / disk selectors on already existing sc. i'll talk to harvester team to see if they have any thoughts on how to reorganize it w/o breaking things.
thanks!