Using the node selector

You can use nodeSelector to control on what nodes IBM Spectrum Scale Container Storage Interface driver should be installed.

By default, IBM Spectrum Scale Container Storage Interface driver gets deployed on all worker nodes. Node selector controls on which Kubernetes worker nodes IBM Spectrum Scale Container Storage Interface driver should be running. It helps in cases where new worker nodes are added to Kubernetes cluster but does not have IBM Spectrum Scale installed. It helps in ensuring that StatefulSets are running on the desired nodes.

To configure node selector, perform the following steps:
  1. Label the Kubernetes worker nodes where StatefulSets should run, as follows:
    • kubectl label node node1 infranode=1 --overwrite=true
    • kubectl label node node2 infranode=2 --overwrite=true
    Note:
    • Use specific labels like the one for attacher and provisioner StatefulSet only if there is a requirement of running these StatefulSets of very specific nodes. Otherwise, use single label like scale=true for running StatefulSets and IBM Spectrum Scale Container Storage Interface driver DaemonSet.
    • Nodes marked for running StatefulSet must be subset of the nodes marked with the scale=true label.
  2. Label the Kubernetes worker nodes where IBM Spectrum Scale Container Storage Interface driver should run, as follows:
    kubectl label node node1 scale=true --overwrite=true
  3. Configure the following parameters in the Operator custom resource (ibm-spectrum-scale-csi-operator-cr.yaml) under the "spec" section: IBM Spectrum Scale client must be installed and running on the nodes that have the scale=true label.
    
    attacherNodeSelector:
       - key: "scale"
         value: "true"
    #  - key: "infranode"       # Only if there is requirement of running Attacher 
    #    value: "2"             # on specific Node
    
    provisionerNodeSelector:
       - key: "scale"
         value: "true"
    #  - key: "infranode".      # Only if there is requirement of running Provisioner
    #    value: "1"             # on specific Node
    
    pluginNodeSelector:
       - key: "scale"
         value: "true"
    
Note: If you choose to run IBM Spectrum Scale Container Storage Interface driver on selective nodes using the nodeSelector, then make sure that the pod using IBM Spectrum Scale Container Storage Interface driver PVC is getting scheduled on the nodes where IBM Spectrum Scale Container Storage Interface driver is running.