nodeSelector
nodeSelector
is a simple Pod scheduling feature that allows scheduling a Pod onto a node. You can add the nodeSelector
field to your Pod specification and specify the node labels you want the target node to have. Therefore, the Pod can be scheduled onto the nodes that have the specified labels.
kubectl taint nodes
command, see Taint and Toleration.
<key, value, effect>
using the matching operator <operator>
.
When a Pod tolerates a node taint, the Pod can be scheduled to the node.
Configure the tolerations property of the StreamNative components in the values.yaml
YAML file as follows, and update the resource.
effect
: indicate what to do with intolerant Pods. Allowed values are NoSchedule
, PreferNoSchedule
, NoExecute
.
When it is set to an empty value, this toleration matches all taints.
key
: the taint key that the toleration applies to.
If the key
is empty, the operator
field must be set to Exists
. This combination means to match all values and all keys.
operator
: the match operator to compare key to the value. Allowed operators are Exists
and Equal
. By default, it is set to Equal
.
Exists
is equivalent to a wildcard for value, so that a Pod can tolerate all taints of the key
.
value
: the taint value the toleration matches to. If the operator
is set to Exists
, the value must be empty.
tolerationSeconds
: the time period that the toleration tolerates the taint. This field is available only when effect
is set to NoExecute
. Otherwise, this field is ignored.
By default, it is not set, which means to tolerate the taint forever (not evicting the taint).
Zero and negative values are treated as 0
(evicting the taint immediately).
node1
:
zookeeper
, bookkeeper
, autorecovery
, broker
, proxy
) enable Pod anti-affinity.
To disable Pod anti-affinity, you can configure the <component>.affinity.anti_affinity
property of the StreamNative components in the values.yaml
YAML file as follows, and update the resource.
requiredDuringSchedulingIgnoredDuringExecution
: to be scheduled onto a node, a Pod must satisfy these rules.preferredDuringSchedulingIgnoredDuringExecution
: the scheduler schedules the Pods, which satisfy the specified affinity expressions, to nodes , but it may choose a node that violates one or more of the expressions. The node with the greatest sum of weights is most preferred.<component>.affinity.type
property of the StreamNative components in the values.yaml
YAML file as follows, and update the resource.
nodeSelector
for StreamNative componentsnodeSelector
, you need to add a label to the target node. For details about placing a label on a node using the kubectl label nodes
command, see add a label to a node.
For example, the following label is placed on node1
:
<component>.nodeSelector
field for a specific StreamNative component with the node’s label and the Pod can be scheduled onto the target node.