⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All Platform Engineering & IDP Interview Questions Scenario 17 of 50 in Platform Engineering & IDP
Senior Platform Engineer Platform Engineering FinOps & Developer Work environments Environment FinOps
🎯 Target Role / Context: Senior Platform Engineer Interview · Platform FinOps & Operations

Q: Non-production EKS clusters cost $85,000/month because developers leave hundreds of test pods, load balancers, and PVCs running overnight and over weekends. How do you design automated environment sleep schedules and TTL enforcement without breaking active debugging?

Automating after-hours resource hibernation and aggressive garbage collection across non-production Kubernetes clusters.

#Platform Engineering #FinOps #Kubernetes #Kube-Downscaler #Cost Optimization #DevEx
🎙️ Candidate Opening & Architectural Context
"Over 65% of non-production cloud spend occurs outside working hours (nights and weekends) when compute sits completely idle. Platform teams implement automated downscaling controllers like kube-downscaler or custom controllers with developer opt-out annotations."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: Over 65% of non-production cloud spend occurs outside working hours (nights and weekends) when compute sits completely idle. Platform teams implement automated downscaling controllers like kube-downscaler or custom controllers with developer opt-out annotations.

1

Deploy Kube-Downscaler with Organizational Business Hours Schedule

Install kube-downscaler configured to scale Deployments, StatefulSets, and HorizontalPodAutoscalers to 0 replicas between 8:00 PM and 7:00 AM weekdays, and all weekend long.

# kube-downscaler Helm values
parameters:
  DEFAULT_UPTIME: 'Mon-Fri 08:00-20:00 Europe/London'
  EXCLUDE_NAMESPACES: 'kube-system,monitoring,argocd'
  DOWNSCALE_PERIOD: 'Mon-Fri 20:00-08:00,Sat-Sun 00:00-24:00'
2

Provide Developer Self-Service Override Annotations

Empower engineers conducting late-night deployments or overseas testing to temporarily pause hibernation using simple annotations or a Backstage button.

# Developer namespace annotation to pause downscaling for 24h
kubectl annotate namespace team-qa downscaler/exclude-until="2026-10-15T12:00:00Z" --overwrite
Advertisement
3

Garbage Collect Orphaned Ephemeral PVCs and LoadBalancers

Run a daily Kubernetes CronJob that identifies namespaces labeled environment=ephemeral with no updated commits in 48 hours, automatically deleting the namespace to release attached EBS volumes and ALBs.

Pro Tip: FinOps Result: Sleeping non-production clusters for 12 hours on weeknights and 48 hours on weekends reduces compute bills by 55%, saving over $46,000 per month.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Automate non-production environment sleep schedules with kube-downscaler outside business hours while providing self-service exemption annotations."
⚡ 60-Second Elevator Pitch Talking Points
  • Enforce automated night and weekend downscaling across non-prod namespaces using kube-downscaler.
  • Provide developer self-service annotations to temporarily exempt namespaces under active testing.
  • Aggressively garbage-collect orphaned PVCs and Cloud Load Balancers from stale preview namespaces.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Confusing ALB 502 Bad Gateway (target connection reset) with 504 Gateway Timeout (upstream response timeout) when configuring Developer Environment Cost 502 indicates the backend target closed the TCP connection prematurely or returned malformed HTTP, whereas 504 means the target failed to respond before idle timeout.
  2. Setting target deregistration delay to zero instead of allowing connection draining when configuring Developer Environment Cost Instant target deregistration severs in-flight HTTP requests during auto-scaling scale-in or rolling deployments, causing immediate user-facing drops.
  3. Failing to query CloudWatch ELB metrics (HTTPCode_ELB_5XX vs HTTPCode_Target_5XX) during load balancer outages when configuring Developer Environment Cost Comparing load balancer generated errors against target generated errors immediately isolates whether the issue lies in the proxy tier or application runtime.
  4. Overlooking Security Group rules on backend EC2/ECS instances that block health check traffic from the ALB when configuring Developer Environment Cost Target instances must explicitly permit inbound HTTP/HTTPS traffic from the ALB security group on the configured container/application port.
Advertisement
Want more Platform Engineering & IDP scenarios?
Explore our complete collection of scenario-based Platform Engineering & IDP interview runbooks.
Browse All Platform Engineering & IDP Questions →