⚡ ~/naveed Interview Prep
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 998+ 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) →
Senior DevOps / SRE [L2] Kubernetes Advanced Scenarios Production Scenario [L2]

Q: How do you pass sensitive configuration (like DB passwords) to a pod without hardcoding them?

Use Kubernetes Secrets:

#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

Use Kubernetes Secrets:

  • Create a secret: kubectl create secret generic db-creds --from-literal=password=mypassword
  • Reference in pod as env var:
2️⃣

Remediation & Permanent Safeguards

Or mount as a file: File mounting is more secure — env vars can leak in logs and process listings. Also avoid printing env vars in app error messages.

env:
- name: DB_PASSWORD
  valueFrom:
    secretKeyRef:
      name: db-creds
      key: password
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Create a secret: kubectl create secret generic db-creds --from-literal=password=mypassword."
⚡ 60-Second Elevator Pitch Talking Points
  • Create a secret: kubectl create secret generic db-creds --from-literal=password=mypassword
  • Reference in pod as env var:
Advertisement
Want more Kubernetes scenarios?
Explore our complete collection of scenario-based Kubernetes interview runbooks.
Browse All Kubernetes Questions →

📚 Related Production Scenarios in Kubernetes