🦉
Programming Notes
  • My Programming Notes
  • CKA Exam Preparation
    • Certified Kubernetes Administrator
    • Setup Minikube
    • Network Design Principles
    • Role-Based Access Control (RBAC)
    • Namespace
    • Resource Quota
    • Pod
    • Deployment
    • Deployment: Rollout
    • ConfigMap
    • Service
    • Service: kubectl expose
    • Pod: Resources Management
    • Pod & Container: Quality of Service Class
    • Pod & Container: Probes
    • Limit Range
    • Scaling: Manual
    • Scaling: Horizontal Pod Autoscaler
    • Persistent Volume & Claim
    • Secret
    • Ingress: Routing
    • Ingress: TLS
    • Ingress: Rate Limit
    • Ingress: Basic Auth
    • Ingress: CRD (Custom Resource Definition)
    • Job
    • CronJob
    • Mutli-Node Cluster
  • Golang
    • Generics
    • Context
    • Goroutines and Channels in Go
    • Goroutine: Concurrency vs Parallelism
    • Goroutine: Performance & Tradeoffs
    • JSON: omitzero
  • Rust
    • Arrays & Slices
    • Closures
    • Generics & Traits
    • Iterators
    • Run Code Simultaneously
    • String vs &str
    • Tests
    • Rustlings Exercises
      • Variables
      • Functions
      • If
      • Primitive Types
      • Vectors
      • Move Semantics
      • Structs
      • Enums and Matching Pattern
      • Strings
      • Modules
      • Hashmaps
      • Options
      • Error Handling
      • Generics
      • Traits
      • Lifetimes
      • Tests
      • Iterators
      • Smart Pointers
      • Threads
      • Macros
      • Quiz 1
      • Quiz 2
      • Quiz 3
  • Software Engineering
    • CAP Theorem
    • Circuit Breaker
    • Decoupling
    • GraphQL: Query Caching
    • HMAC Signature
    • Idempotency
    • Monolith VS Microservice
    • OWASP Top 10 2021
    • PCI DSS
    • PostgreSQL: Partitioning
    • PostgreSQL: Replication
    • Protobuf & gRPC
    • Redis: Streams
    • Resource Scaling
    • Signed URL
    • SOLID
    • Stack VS Heap
    • Stateful VS Stateless
  • Site Reliability Engineering
    • Chaos Engineering
    • Distributed Tracing
    • Kubernetes (k8s)
    • SLA, SLO, and SLI Metrics
    • Site Reliability Engineer
  • Others
    • FFMPEG Cheat sheet
Powered by GitBook
On this page
  • Guaranteed
  • Burstable
  • BestEffort
  • Eviction Order
  • References
  1. CKA Exam Preparation

Pod & Container: Quality of Service Class

Kubernetes classifies the Pods that we run and allocates each Pod into a specific quality of service (QoS) class. Kubernetes assigns every Pod a QoS class based on the resource requests and limits of its component Containers. QoS classes are used by Kubernetes to decide which Pods to evict from a Node experiencing Node Pressure.

The possible QoS classes are Guaranteed, Burstable, and BestEffort.

Guaranteed

  • This is the highest QoS class in kubernetes. These pods are the least likely to face eviction.

  • Never throttled as long as limits are not exceeded.

  • They are guaranteed not to be killed until they exceed their limits or there are no lower-priority Pods that can be preempted from the Node.

Criteria:

  • Every container in the pod must have CPU request and limit with equal value.

  • Every container in the pod must have Memory request and limit with equal value.

Burstable

  • Higher priority than BestEffort but lower than Guaranteed.

  • If a limit is not specified, it defaults to a limit equivalent to the capacity of the Node, which allows the Pods to flexibly increase their resources if resources are available (burstsable).

  • Can get throttled or evicted if usage exceeds requests.

Criteria:

  • The Pod does not meet the criteria for QoS class Guaranteed.

  • At least one Container in the Pod has a memory or CPU request or limit.

BestEffort

  • This is the lowest QoS class in kubernetes.

  • These pods are the most likely to face eviction.

  • These pods will use any amount of compute resource available.

    For example, if you have a node with 16 CPU cores available to the kubelet, and you assign 4 CPU cores to a Guaranteed Pod, then a Pod in the BestEffort QoS class can try to use any amount of the remaining 12 CPU cores.

Eviction Order

When Kubernetes needs to evict pods due to CPU or Memory limit, it follows this order.

  • BestEffort Pods (No CPU/memory requests set)

  • Burstable Pods (Some requests but no strict limits)

  • Guaranteed Pods (Requests = Limits)

References

PreviousPod: Resources ManagementNextPod & Container: Probes

Last updated 3 months ago

https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/