Skip to content

Kubernetes Guaranteed QoS

Kubernetes Guaranteed QoS is a service quality class assigned to Pods that ensures the highest level of resource allocation and stability.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md] This classification is part of the broader Kubernetes resource management system, which defines how compute resources like [[CPU]] and [[Memory]] are distributed across a cluster.

Definition

A Pod is classified as Guaranteed when specific conditions are met regarding its resource requests and limits.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md] For a Pod to receive this QoS class, every container within it must satisfy the following rule:

  • The memory request must equal the memory limit.
  • The cpu request must equal the cpu limit.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md]

This configuration ensures that the container is guaranteed a fixed amount of resources, preventing resource contention with other workloads.

Configuration Example

The following manifest demonstrates a Pod configuration that results in a Guaranteed QoS class.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md] Note that the values specified in resources.requests match those in resources.limits.

apiVersion: v1
kind: [Pod](<./pod.md>)
metadata:
  name: qos-demo
  namespace: qos-example
spec:
  containers:
  - name: qos-demo-ctr
    image: nginx
    resources:
      limits:
        memory: "200Mi"
        cpu: "700m"
      requests:
        memory: "200Mi"
        cpu: "700m"

Characteristics and Behavior

Guaranteed Pods represent the highest priority class within Kubernetes resource management.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md] As a result, they possess specific characteristics regarding cluster lifecycle and resource contention:

  • High Priority: They are afforded the highest priority compared to other QoS classes like [[Burstable]] and [[BestEffort]].
  • Protection from Eviction: Under normal circumstances, Guaranteed Pods will not be killed or throttled to free up resources.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md]
  • Last Resort: Kubernetes will typically terminate lower-priority Pods (such as BestEffort) first. Guaranteed Pods are only subject to termination if their resource usage exceeds their defined limits and no lower-priority Pods are available to be killed.^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md]

Sources

^[400-devops-06-kubernetes-k8s-ithelp-day21-readme.md]