Score:0

Node pool selection

jp flag

I have a Kubernetes cluster with many node pools. Sometimes the deployment fails because the selected node pool that Kubernetes select has not enough available resources.

Is there some way to force Kubernetes to select a node pool with the amount of resources that the whole set of pods requested?

Score:2
cn flag

You can constrain a Pod so that it can only run on a particular set of node(s). There are several ways to do this and the recommended approach is to use label selectors.

You can use any of the following methods to choose where Kubernetes schedules specific Pods:

  • nodeSelector field matching against node labels

  • Affinity and anti-affinity

  • nodeName field

A node selector specifies a map of key/value pairs that are defined using custom labels on nodes and selectors specified in pods.

For the pod to be eligible to run on a node, the pod must have the same key/value node selector as the label on the node.

Note : You cannot add a node selector directly to an existing scheduled pod.

nodeSelector is the simplest way to constrain Pods to nodes with specific labels whereas Affinity and anti-affinity expands the types of constraints you can define. The affinity feature consists of two types of affinity:

  • Node affinity functions like the nodeSelector field but is more expressive and allows you to specify soft rules.
  • Inter-pod affinity/anti-affinity allows you to constrain Pods against labels on other Pods.

For nodename you can refer to the link for more information.

Node affinity is a property of Pods that attracts them to a set of nodes and as said nodeselector is used to constrain pods. So, you can use Taints and Tolerations.

Taints are opposite in that they allow a node to repel a set of pods. Tolerations are applied to pods, and allow the pods to schedule onto nodes with matching taints.Taints and tolerations work together to ensure that pods are not scheduled onto inappropriate nodes. One or more taints are applied to a node. This marks that the node should refuse any pods that do not tolerate the taints.

You can refer to the links for more information on taints and tolerance.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.