Q: Explain the difference between `kubectl apply` with a file vs `kubectl apply -k` (kustomize).
-f applies a single file or directory of raw YAML. -k runs Kustomize, applying base + overlays, generating configs, and applying the merg...
#Kubernetes #Advanced Scenarios #L2 #Container Orchestration #K8s
🎙️ Candidate Opening & Architectural Context
""When troubleshooting Kubernetes, I always follow a structured layered model: Pod status -> Events -> Logs -> Network. 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
-f applies a single file or directory of raw YAML. -k runs Kustomize, applying base + overlays, generating configs, and applying the merged result.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: -f applies a single file or directory of raw YAML. -k runs Kustomize, applying base + overlays, generating configs, and applying t."
⚡ 60-Second Elevator Pitch Talking Points
- Immediate Triage: -f applies a single file or directory of raw YAML. -k runs Kustomize, applying base + overlays,
- Run targeted verification commands before modifying configuration.
- Automate permanent guardrails (CI check, alerts, IaC policy) to prevent recurrence.
Advertisement