Node Selector
If you want to restrict Longhorn components to only run on a particular set of nodes, you can set node selector for all Longhorn components. For example, you want to install SUSE Storage in a cluster that has both Linux nodes and Windows nodes but Longhorn cannot run on Windows nodes. In this case, you can set the node selector to restrict SUSE Storage to only run on Linux nodes.
For more information about how node selector work, refer to the official Kubernetes documentation.
Setting up Node Selector for SUSE Storage
SUSE Storage consists of user-deployed components (for example, Longhorn Manager, Longhorn Driver, and Longhorn UI) and system-managed components (for example, Instance Manager, Backing Image Manager, Share Manager, CSI Driver, and Engine Image). You need to set node selector for both types of components. See more details below.
Setting up Node Selector During installing SUSE Storage
-
Set the node selector for user-deployed components (for example, Longhorn Manager, Longhorn Driver, and Longhorn UI).
-
If you install SUSE Storage through Rancher, you must copy and paste the following parameters into the YAML on the Rancher UI (click Edit as YAML during the installation) to apply the value to all user-deployed components.
global: nodeSelector: label-key1: "label-value1" -
You can also specify the node selector for each user-deployed component and it will override the global setting.
longhornManager: nodeSelector: label-key1: "label-value1" longhornDriver: nodeSelector: label-key1: "label-value1" longhornUI: nodeSelector: label-key1: "label-value1" -
If you install SUSE Storage by using
kubectlto apply the deployment YAML, you need to modify the node selector section for Longhorn Manager, Longhorn UI, and Longhorn Driver Deployer. Then apply the YAMl files. -
If you install SUSE Storage using Helm, you can change the Helm values for
global.nodeSelector,longhornManager.nodeSelector,longhornUI.nodeSelector,longhornDriver.nodeSelectorin thevalues.yamlfile before installing the chart.
-
-
Set the node selector for system-managed components (for example, Instance Manager, Backing Image Manager, Share Manager, CSI Driver, and Engine Image).
Follow the Customize default settings to set node selector by changing the value for the
system-managed-components-node-selectordefault settingBecause of the limitation of Rancher 2.5.x, if you are using Rancher UI to install SUSE Storage, you need to click
Edit As Yamland add settingsystemManagedComponentsNodeSelectortodefaultSettings.For example:
defaultSettings: systemManagedComponentsNodeSelector: "label-key1:label-value1"
Setting up Node Selector After SUSE Storage has been installed
|
-
Prepare
-
To ensure that your preferred settings are immediately applied, stop all workloads and detach all Longhorn volumes before applying it.
-
-
Set the node selector for user-deployed components (for example, Longhorn Manager, Longhorn Driver, and Longhorn UI).
-
If you install SUSE Storage through Rancher, you must copy and paste the following parameters into the YAML on the Rancher UI (click Edit as YAML during the upgrade) to apply the value to all user-deployed components.
global: nodeSelector: label-key1: "label-value1" -
You can also specify the node selector for each user-deployed component and it will override the global setting.
longhornManager: nodeSelector: label-key1: "label-value1" longhornDriver: nodeSelector: label-key1: "label-value1" longhornUI: nodeSelector: label-key1: "label-value1" -
If you install SUSE Storage by using
kubectlto apply the deployment YAML, you need to modify the node selector section for Longhorn Manager, Longhorn UI, and Longhorn Driver Deployer. Then reapply the YAMl files. -
If you install SUSE Storage using Helm, you can change the Helm values for
global.nodeSelector,longhornManager.nodeSelector,longhornUI.nodeSelector,longhornDriverDeployer.nodeSelectorin thevalues.yamlfile, and then runhelm upgradeto upgrade to the new version of the chart.
-
-
Set the node selector for system-managed components (for example, Instance Manager, Backing Image Manager, Share Manager, CSI Driver, and Engine Image).
The node selector setting can be found at SUSE Storage UI under .
-
Clean up
If you are changing node selector in a way so that SUSE Storage cannot run on some nodes that SUSE Storage is currently running on, those nodes will become
downstate after this process. Verify that there is no replica left on those nodes. Disable scheduling for those nodes, and delete them in SUSE Storage UI.