Scheduling-K8S

1. Overview

  • The scheduling component in Kubernetes is a core responsibility of the control plane.
  • Assign pods to nodes ensuring optimal resource allocation and management.

2. Primary Functionalities

2.1. Resource Optimization

  • Considers CPU, memory requests, and constraints.

2.2. Affinity/Anti-affinity Rules

2.3. Taints and Tolerations

2.4. NodeSelector and NodeAffinity

  • Limits nodes that can host particular pods.

2.5. Priorities and Preemption

2.7. Scheduler Algorithms:

  • Priority Functions: Rank nodes based on set criteria.
  • Predicate Functions: Determines if a pod can run on a particular node.

2.8. Custom Schedulers:

  • Allows for user-defined policies and scheduling strategies.

3. Kube-Scheduler

Two basic stages to allocating a pod to a node:

  • Filtering : disqualify candidates
  • Scoring : prioritize candidates

3.1. Scheduling Policies

  • configure predicates(for filtering) and Priorities(for scoring)

3.2. Scheduling Profiles

  • configure plugins that implement different scheduling stages:
    • QueueSort
    • Filter
    • Score
    • Bind
    • Reserve
    • Permit

4. Scheduling Framework

The allocation of a pod is split in two phases:

  • Scheduling Cycle : Decides
  • Binding Cycle : applies the decision
Tags::k8s: