Urgent.News

What's breaking now, across thousands of outlets.

Culture

Why Your Pod Is Stuck in Pending, Explained With a Restaurant Host Stand

You're the host at a busy restaurant on a Friday night. A party of four walks in. Before you seat them, you run a quick checklist in your head: which tables are big enough, which ones are reserved, which section they asked for, and who they shouldn't be seated next to. If no table passes, they go on the waiting list. That is the Kubernetes scheduler. Every pod is a party, every node is a table,…

Imagine a bustling restaurant on a Friday night. As the host, your task is to seat parties based on their requirements. You check for tables that are large enough, reserved, in the requested section, and don't have conflicts with other parties. If no suitable table is found, the party goes on the waiting list. This process resembles Kubernetes scheduling, where each party is a pod, each node is a table, and "Pending" is the waiting list.

When a party requests a specific number of seats, the host holds a table for that number, regardless of the actual usage. Similarly, when a pod requests a certain amount of CPU and memory, it takes those resources from the node's total capacity, even if it's idle. The scheduler doesn't consider actual usage, but rather the requested resources.

A party's limits are different from their requests. Limits define the maximum amount they can consume. If a party exceeds its CPU limit, it's slowed down; if it exceeds its memory limit, it's closed down and restarted. However, limits don't affect seating. The scheduler only sees the reservation.

The scheduling process involves two phases: filtering and scoring. Filtering removes nodes that can't accommodate the pod's requirements, such as insufficient CPU or memory, incompatible taints, or affinity rules. The remaining nodes are then scored based on factors like spreading replicas apart or balancing resource usage. The pod is assigned to the highest-scoring node.

If no nodes pass the filtering phase, the pod remains in "Pending" status. The scheduler records why it rejected each node. These reasons can help identify issues like insufficient memory, untolerated taints, or incompatible node affinities.

Reserved tables, or nodes with taints, work similarly to a host card on a table. A toleration, or pass, allows a pod to occupy a reserved table, but doesn't necessarily seat it there. To ensure pods only occupy specific nodes, you need both tolerations (permission to enter) and node affinity or nodeSelector (instructions to seat there).

Node affinity is a seating request, while affinity is the host walking you to the table. For example, a pod might request to sit in the patio area.

Anti-affinity and spread constraints are about not placing similar parties or pods together. This can prevent issues like all replicas of a service landing on a single node, which could cause a failure in the entire service.

Lastly, persistent volumes, or your coat checked in the coat check, can cause issues if they're not properly bound to the correct zone. This can result in a pod waiting indefinitely, even if other zones are available.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Culture

MND Tutor | Teen inventor

A Chiapas teenager who developed a solar water heater using recycled materials at age 8 has won presidential backing for her invention. Learn more about it with MND Tutor. The post MND Tutor | Teen inventor appeared first on Mexico News Daily

More from Saturday 14 November →