tinycodinglm / sys /sys-0028.jsonl
winapiadmin's picture
Upload folder using huggingface_hub (part 19)
034ba67 verified
|
Raw History Blame
1.2 kB
opencode trace
System You are an expert software engineer.

You are an expert software engineer.

User

How does the Kubernetes scheduler work?

Assistant

The scheduler assigns pods to nodes using a multi-phase filter+score approach:

  1. Queue: Pods arrive in SchedulingQueue (sorted by priority)
  2. Filter: Remove nodes that don't meet constraints (resources, affinity, taints, PV)
  3. Score: Rank remaining nodes (resource balance, affinity, spread)
  4. Select: Pick highest-scoring node

Key types:

  • Scheduler struct: Cache, SchedulingQueue, Profiles, FailureHandler
  • framework.Framework: plugin-based scoring/filtering pipeline
  • NodeInfo: per-node resource snapshot

Event handlers: addPod, addNodeToCache, deleteNodeFromCache
All writes go through workqueue with rate limiting and exponential backoff.

Cache: nodeInfoSnapshot provides thread-safe read access to node state.
Pods in scheduling queue: active, backoff, unschedulable queues for retry logic.