Q: What is `kubectl apply --prune`?
When combined with a label selector, it deletes resources that were previously applied with kubectl apply but are no longer in the curren...
#Kubernetes #Additional Kubernetes Scenarios (Q101-Q200) #L2 #Container Orchestration #K8s #Git
🎙️ Candidate Opening & Architectural Context
""In one of our high-traffic production clusters, our SRE team handled this incident using a standardized runbook. 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️⃣
Production Solution & Architecture
When combined with a label selector, it deletes resources that were previously applied with kubectl apply but are no longer in the current manifest set. Useful for GitOps without a full GitOps controller — cleans up old resources.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: When combined with a label selector, it deletes resources that were previously applied with kubectl apply but are no longer in the."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: When combined with a label selector, it deletes resources that were previously applied with kub
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement