Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 137/ 160
07. Observability, Troubleshooting & SRE

Service Level Objectives (SLOs) & Error Budgets for K8s Services

Define SLOs and error budgets that gate releases for Kubernetes services.

IntermediateSLO · Error Budget · SLI3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

An SLO is the promised share of good trips, and the error budget is the remaining puncture allowance before maintenance changes stop. The simple Kubernetes rule is: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Think of it like…

An SLO is the promised share of good trips, and the error budget is the remaining puncture allowance before maintenance changes stop.

Where you’ve seen it

An SRE testing a diagnosis runs kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'. Expected evidence: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases. If the run instead shows this symptom, stop and restore the last known state: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.

Words you’ll hear

SLO
For this lesson, SLO is the controlling idea: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.
Error Budget
Error Budget is the checkpoint; run kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' and inspect the owner chain. An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.
SLI
SLI is the outcome to preserve; the cost is explicit: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.
Verification evidence
The evidence command is kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'. It connects the declaration to this behavior: Define SLOs and error budgets that gate releases for Kubernetes services.

Visual diagram

Loading interactive diagram

Theory & deep dive

How SLO reaches the intended state

Define SLOs and error budgets that gate releases for Kubernetes services. An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

The concrete checkpoint is kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'; compare the SLO owner, Error Budget state, and SLI outcome instead of treating YAML acceptance as proof.

Verify Error Budget, not only object creation

Run kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' after the change and correlate the result with Events and the owning object. An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Key takeaway: SLO is implemented only when this invariant remains observable: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Error Budget: failure boundary and production cost

An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership. The prerequisite contract is concrete: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn. A safe design limits blast radius, records the last good configuration, and uses kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' as a deterministic rollback checkpoint.

Recover from Error Budget drift

Capture the current state with kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))', then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.

Key takeaway: Accept the trade-off consciously: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.

How it works, step by step

Step 1 of 4
SRE and service owner

1. Define the symptom and SLI

Turn the user symptom into a measurable question and select a telemetry source: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

SLO contract → owned state
Key numbers at this step
Goal
Define SLOs and error budgets that gate releases for Kubernetes services.
Owner
SLO

When to use it & trade-offs

What it is

Define SLOs and error budgets that gate releases for Kubernetes services. An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Why it matters: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership. The invariant at risk is specific: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases. The quickest fact check before changing the design is kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'.

When to reach for it

  • Use SLO to enforce this invariant: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.
  • Use Error Budget evidence from kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' in reviews and incident timelines. Define SLOs and error budgets that gate releases for Kubernetes services.
  • Choose the managed observability backend route only when this cost is justified by governance or scale: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.

When to avoid or be careful

  • Avoid assuming SLO is complete after YAML submission; the required behavior is concrete: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.
  • Avoid treating the next symptom as random; check the owner and state with kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' first: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.
  • Avoid adopting a heavier platform wrapper before measuring its cost: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.

Native, manual, and managed paths for SLO

Metrics and evidence-led diagnosis
Best for: Define SLOs and error budgets that gate releases for Kubernetes services. A concrete incident check is kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'.

Strengths: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Watch out: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn. Recovery must also recognize this signal: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.

Ad-hoc console inspection
Best for: Quickly testing the Error Budget assumption with kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'; the expected invariant is: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Strengths: kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike SLO, it does not make this symptom self-documenting: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.

Managed observability backend
Best for: Teams that need SLI integrated with guardrails; the evidence path is kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))'.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.

Watch out: The added platform ownership buys value at this cost: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.
  • Trace SLO to SLI through Error Budget; the invariant is: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.
  • Recognize the symptom: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.
  • Justify the cost: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.
  • Verify with kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' instead of only inspecting YAML.

Benchmarks & rules of thumb

99.9% -
example monthly availability SLO with roughly 43.2 minutes of allowed downtime in 30 days
2 -
burn-rate windows often pair fast and slow
1 -
SLI denominator should match eligible user events

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the SLO owner contract: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases.
  • Ignoring this telltale condition leads to unrelated changes: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership.
  • Repeating kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))' without an owner for remediation wastes retry cost. Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases?
  • Which owner object, logs, and Events would you inspect for this symptom-An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership-?
  • At what threshold would this cost become unacceptable: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn?
Interview tip: Interview sequence: state the invariant, run kubectl get prometheus,alertmanager -A; curl -g 'http://prometheus:9090/api/v1/query?query=1-sum(rate(http_requests_total{code=~"5.."}[30d]))/sum(rate(http_requests_total[30d]))', name the failure, then justify the cost. Invariant: An SLI such as successful requests or ready latency defines an SLO target, and the remaining failure allowance is the error budget that can gate risky releases. Failure: An availability SLO built from only PodReady misses user request failures, and an arbitrary cluster-wide alert burns budget without a policy for release ownership. Cost: Error budgets balance delivery and reliability, but window, event volume, exclusions, and attribution must be agreed before alerting on burn.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Service Level Objectives (SLOs) & Error Budgets for K8s Services with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Chaos Engineering on Kubernetes (LitmusChaos / Chaos Mesh)
Next topic
Cost Allocation & FinOps Best Practices (Spot/Preemptible Nodes)