This is meant as a short introduction to the various options that influence scheduling when using the Piraeus chart. To influence pod placement, we use the Kubernetes concepts of tolerations and affinity.
If you are running multiple replicas to achieve High Availability, you want pods to be distributed across as many nodes as possible. This ensures that failure of a single node does not interrupt a critical set of pods.
The way to achieve scheduling on different nodes is by using podAntiAffinity
:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: etcd
topologyKey: "kubernetes.io/hostname"
This affinity setting ensures that only one pod with label app: etcd
will be scheduled per node.
Piraeus will use such affinity
settings by default for:
etcd
change by settingoperator.etcd
operator
change by settingoperator.affinity
Piraeus controller
change by settingoperator.controller.affinity
CSI controller
change by settingcsi.controllerAffinity
To allow pods to be placed on master nodes, you need add tolerations:
tolerations:
- key: node-role.kubernetes.io/master
operator: "Exists"
effect: "NoSchedule"
This toleration allows pods to be scheduled on master nodes.
Note that using tolerations this way only allows scheduling on master nodes, but does not force it. The pod can still
end up on a worker node. To force scheduling on master nodes, use affinity settings to set the nodeAffinity
.
By default, piraeus will set this toleration for the etcd
pods. Tolerations can be set on:
etcd
by settingetcd.tolerations
operator
by settingoperator.tolerations
Piraeus controller
by settingoperator.controller.tolerations
Piraeus satellites
by settingoperator.satelliteSet.tolerations
CSI controller
by settingcsi.controllerTolerations
CSI nodes
by settingcsi.nodeTolerations