Kubernetes Pod Scheduling Mechanishm

I have some basic questions regarding Kubernetes Cluster. Let’s assume that there are three node-pools with different cpu and ram and there is one node per node-pool already.

When provisioning, if there is enough space to all the existing nodes, where the underlying pod is going to be scheduled if affinity, tolleration and resource request/limits match with all the three nodes?

When provisioning, if there is no enough space to all the existing nodes, which nodepool will be triggered for scale if autoscaling is enabled, affinity, tolleration and resource request/limits match with all the three nodes?

When provisioning a pod in a Kubernetes cluster with three node-pools, if the resource requests/limits, affinity, and tolerations match all the nodes, the Kubernetes scheduler will select a node based on available resources and the default scheduling algorithm, which aims to distribute the load efficiently. If there is sufficient space on all nodes, the pod will be scheduled on any of the available nodes that meet the requirements. However, if there is not enough space, and autoscaling is enabled, Kubernetes will trigger scaling in the node pool based on the autoscaler configuration, typically prioritizing the node pool with the least current resource usage or the one that can scale most efficiently, considering cost and performance.

1 Like