Q: What is a LimitRange and why would you use it?
A LimitRange sets default and maximum resource requests/limits for pods in a namespace. If a pod doesn't specify resources, LimitRange fi...
#Kubernetes #Advanced Scenarios #L2 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
""Kubernetes is a declarative desired state system; understanding the reconciliation loop is how you diagnose this quickly. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
A LimitRange sets default and maximum resource requests/limits for pods in a namespace. If a pod doesn't specify resources, LimitRange fills in defaults.
- Prevent runaway pods — without limits, one pod can consume all node CPU/memory.
- Ensure HPA works — HPA needs resource requests set. LimitRange auto-sets them.
- Fair resource sharing — prevent a single team's namespace from monopolizing the cluster.
2️⃣
Remediation & Permanent Safeguards
Why use it: Example:
limits:
- default:
cpu: 500m
memory: 256Mi
defaultRequest:
cpu: 100m
memory: 128Mi
type: Container
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Prevent runaway pods — without limits, one pod can consume all node CPU/memory.."
⚡ 60-Second Elevator Pitch Talking Points
- Prevent runaway pods — without limits, one pod can consume all node CPU/memory.
- Ensure HPA works — HPA needs resource requests set. LimitRange auto-sets them.
- Fair resource sharing — prevent a single team's namespace from monopolizing the cluster.
Advertisement