QuickDevGuide

Home › Kubernetes

Best Practices — Kubernetes

Do's # Practice Reason 1 Set resource requests AND limits Prevents resource starvation; enables HPA 2 Use namespaces Isolate environments (billing-dev, billing-staging, billing-prod) 3 Use health probes K8s needs pod health info for self-healing 4 Use Secrets for credentials Never hardcode passwords in manifests 5 Pin image tags 1.0.0 not latest — reproducible deployments 6 Use rolling update strategy Zero-downtime deployments 7 Set pod disruption budgets Prevent all pods from being evicted simultaneously Don'ts # Anti-pattern Correct Approach 1 Commit secrets to git Use kubectl create secret or external secrets manager 2 Use latest tag Pin exact version (e.g., 1.0.0) 3 Skip resource limits Always set to prevent noisy neighbor issues 4 Run as root Set securityContext.runAsNonRoot: true 5…

Key Takeaways