PerfectScale by DoiT’s Post

How does Kubernetes decide where to run our pod? It's a two-step process. Step 1: Filtering The scheduler looks at every node in the cluster. It removes any node that can't run the pod. Nodes get removed for these reasons: • Not enough CPU or memory • Marked as unschedulable • Missing storage the pod needs • Has a taint the pod can't handle What's left is a list of nodes that qualify. Step 2: Scoring The scheduler scores every node that qualified. The highest score wins. Nodes score higher if they: • Already have the container image • Have balanced CPU and memory usage • Match the pod's scheduling rules Highest score? Pod goes there. Kubelet starts the container. Pod moves from Pending to Running. ✅ We can also influence where pods land: • nodeSelector: send pods to nodes with specific labels • Node Affinity: prefer or require specific nodes • Pod Affinity: place pods near or away from other pods • Taints and Tolerations: block pods from certain nodes Scheduling is not random. Every pod placement is a decision Kubernetes makes based on the rules we set. If we set them well, our cluster runs efficiently, and if we ignore them, pods end up in the wrong place.

  • diagram
See more comments

To view or add a comment, sign in

Explore content categories