Bird
Raised Fist0
Kubernetesdevops~10 mins

Quality of Service classes (Guaranteed, Burstable, BestEffort) in Kubernetes - Interactive Code Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the YAML to set a pod with the BestEffort QoS class by leaving out resource requests and limits.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: best-effort-pod
spec:
  containers:
  - name: app
    image: nginx
    resources:
      [1]
Drag options to blanks, or click blank then click option'
Arequests: {}
Blimits: {}
C(none)
Drequests: memory: "128Mi" limits: memory: "256Mi"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting resource requests or limits causes the pod to be Burstable or Guaranteed.
Using empty requests or limits keys still counts as setting resources.
2fill in blank
medium

Complete the YAML to set a pod with Burstable QoS by specifying resource requests but no limits.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: burstable-pod
spec:
  containers:
  - name: app
    image: nginx
    resources:
      requests:
        memory: [1]
Drag options to blanks, or click blank then click option'
A"256Mi"
B"512Mi"
C"128Mi"
D"1Gi"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting limits causes the pod to be Guaranteed.
Using too small or too large values may not be realistic.
3fill in blank
hard

Fix the error in this pod spec to make it Guaranteed QoS by matching requests and limits exactly.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: guaranteed-pod
spec:
  containers:
  - name: app
    image: nginx
    resources:
      requests:
        cpu: "500m"
        memory: "256Mi"
      limits:
        cpu: [1]
Drag options to blanks, or click blank then click option'
A"1"
B"250m"
C"500m"
D"1000m"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting limits lower or higher than requests causes Burstable QoS.
Using different units causes errors.
4fill in blank
hard

Fill both blanks to create a pod with Burstable QoS by setting CPU requests and limits correctly.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: burstable-pod
spec:
  containers:
  - name: app
    image: nginx
    resources:
      requests:
        cpu: [1]
      limits:
        cpu: [2]
Drag options to blanks, or click blank then click option'
A"250m"
B"500m"
C"1000m"
D"125m"
Attempts:
3 left
💡 Hint
Common Mistakes
Setting requests equal to limits makes pod Guaranteed.
Setting requests higher than limits is invalid.
5fill in blank
hard

Fill all three blanks to define a pod with Guaranteed QoS by matching CPU and memory requests and limits.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: guaranteed-pod
spec:
  containers:
  - name: app
    image: nginx
    resources:
      requests:
        cpu: [1]
        memory: [2]
      limits:
        cpu: [3]
        memory: [2]
Drag options to blanks, or click blank then click option'
A"500m"
B"256Mi"
C"500m"
D"128Mi"
Attempts:
3 left
💡 Hint
Common Mistakes
Using different values for requests and limits causes Burstable QoS.
Mixing units or missing memory limits causes errors.

Practice

(1/5)
1. Which Kubernetes Quality of Service (QoS) class guarantees that a pod will always get the resources it requests?
easy
A. Burstable
B. Guaranteed
C. BestEffort
D. Reserved

Solution

  1. Step 1: Understand QoS classes in Kubernetes

    There are three main QoS classes: Guaranteed, Burstable, and BestEffort. Guaranteed means the pod has resource requests equal to limits.
  2. Step 2: Identify which class ensures resource guarantees

    Guaranteed pods always get the resources they request because requests and limits match exactly.
  3. Final Answer:

    Guaranteed -> Option B
  4. Quick Check:

    Guaranteed = full resource guarantee [OK]
Hint: Guaranteed means requests equal limits, so full resource guarantee [OK]
Common Mistakes:
  • Confusing Burstable with Guaranteed
  • Thinking BestEffort has resource guarantees
  • Assuming Reserved is a QoS class
2. Which of the following pod resource specifications will result in a Burstable QoS class?
easy
A. resources:\n requests:\n cpu: '200m'\n memory: '128Mi'\n limits:\n cpu: '500m'\n memory: '256Mi'
B. resources:\n requests:\n cpu: '500m'\n memory: '256Mi'\n limits:\n cpu: '500m'\n memory: '256Mi'
C. resources:\n requests:\n cpu: '0'\n memory: '0'\n limits:\n cpu: '0'\n memory: '0'
D. resources: {}

Solution

  1. Step 1: Review resource requests and limits for QoS classes

    Guaranteed requires requests equal to limits. Burstable requires requests less than limits. BestEffort has no requests or limits.
  2. Step 2: Match the given specs to Burstable

    resources:\n requests:\n cpu: '200m'\n memory: '128Mi'\n limits:\n cpu: '500m'\n memory: '256Mi' has requests less than limits, so it is Burstable.
  3. Final Answer:

    requests less than limits -> Option A
  4. Quick Check:

    Burstable = requests < limits [OK]
Hint: Burstable means requests less than limits, not equal [OK]
Common Mistakes:
  • Choosing equal requests and limits as Burstable
  • Assuming empty resources means Burstable
  • Confusing zero requests with BestEffort
3. Given this pod spec snippet, what QoS class will Kubernetes assign?
resources:
  requests:
    cpu: '100m'
    memory: '128Mi'
  limits:
    cpu: '100m'
    memory: '128Mi'
medium
A. Burstable
B. BestEffort
C. null
D. Guaranteed

Solution

  1. Step 1: Compare requests and limits in the pod spec

    Requests and limits for both CPU and memory are equal (100m CPU and 128Mi memory).
  2. Step 2: Determine QoS class based on equality

    When requests equal limits for all resources, Kubernetes assigns Guaranteed QoS.
  3. Final Answer:

    Guaranteed -> Option D
  4. Quick Check:

    Requests = Limits means Guaranteed [OK]
Hint: Equal requests and limits means Guaranteed QoS [OK]
Common Mistakes:
  • Choosing Burstable when requests equal limits
  • Thinking BestEffort applies with resource specs
  • Selecting null as a QoS class
4. Given this pod spec snippet, what QoS class will Kubernetes assign?
resources:
  requests:
    cpu: '0'
    memory: '0'
medium
A. BestEffort
B. Burstable
C. Guaranteed
D. It will cause a syntax error

Solution

  1. Step 1: Analyze the resource specification

    Requests are set to cpu: '0' and memory: '0', with no limits defined.
  2. Step 2: Apply QoS classification rules

    Requests are specified but zero values are treated as no requests. No limits are defined. This qualifies as BestEffort, since no resource requests or limits are effectively set.
  3. Final Answer:

    BestEffort -> Option A
  4. Quick Check:

    No requests or limits means BestEffort [OK]
Hint: Zero requests with no limits -> BestEffort (not Burstable) [OK]
Common Mistakes:
  • Thinking it causes a syntax error
  • Assuming zero requests means BestEffort
  • Believing it qualifies as Guaranteed
5. You want to ensure a pod gets guaranteed CPU and memory resources but also allow it to burst beyond the requested amount when available. Which resource configuration and QoS class combination achieves this?
hard
A. Set no requests or limits; QoS class BestEffort
B. Set requests equal to limits; QoS class Guaranteed
C. Set requests less than limits; QoS class Burstable
D. Set limits less than requests; QoS class Burstable

Solution

  1. Step 1: Understand resource guarantees and bursting

    Guaranteed QoS requires requests equal to limits, which means no bursting beyond limits. Burstable allows requests less than limits, enabling bursting.
  2. Step 2: Match configuration to desired behavior

    Setting requests less than limits gives minimum guaranteed resources with ability to burst, which is Burstable QoS.
  3. Final Answer:

    Set requests less than limits; QoS class Burstable -> Option C
  4. Quick Check:

    Burstable = guaranteed minimum + burst capacity [OK]
Hint: Burstable = requests less than limits for bursting [OK]
Common Mistakes:
  • Choosing Guaranteed which disallows bursting
  • Setting limits less than requests (invalid)
  • Assuming BestEffort provides guarantees
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard