Preparing for a DevOps interview that covers Kubernetes? These questions come up again and again - here are strong, concrete answers.
Q: What is Kubernetes and why use it?
Kubernetes is a container orchestrator: you declare the desired state of your workloads in YAML and controllers continuously reconcile the cluster toward it, handling scheduling, scaling, healing and networking.
- Self-healing: crashed pods are restarted and rescheduled automatically
- Declarative rollouts and rollbacks instead of hand-run deploy scripts
- A portable API that runs the same on EKS, AKS, GKE and on-prem
Q: What are the best practices you follow?
- Set requests/limits and use the HorizontalPodAutoscaler for elastic workloads
- Separate config (ConfigMap) from secrets and mount them, don't bake them in
- Use readiness probes to gate traffic and PodDisruptionBudgets for safe drains
- Adopt GitOps (ArgoCD/Flux) so the cluster state lives in reviewed Git
Q: What mistakes have you seen?
- No resource requests/limits - the scheduler can't pack pods and OOM kills surprise you
- Using :latest images so rollbacks and caching become unpredictable
- Liveness probes that are too aggressive, restarting healthy-but-slow pods
- Treating Secrets as encrypted - they are only base64-encoded at rest by default
Q: Show a basic configuration
A Deployment plus Service with probes and resource limits.
apiVersion: apps/v1
kind: Deployment
metadata: { name: web }
spec:
replicas: 3
selector: { matchLabels: { app: web } }
template:
metadata: { labels: { app: web } }
spec:
containers:
- name: web
image: ghcr.io/acme/web:1.0
ports: [{ containerPort: 3000 }]
resources:
requests: { cpu: 100m, memory: 128Mi }
limits: { cpu: 500m, memory: 256Mi }
readinessProbe:
httpGet: { path: /healthz, port: 3000 }
---
apiVersion: v1
kind: Service
metadata: { name: web }
spec:
selector: { app: web }
ports: [{ port: 80, targetPort: 3000 }]Want senior help putting Kubernetes to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.