Member-only story
Top 10 Common DevOps/SRE Interview Questions and Answers on Kubernetes Best Practices
- How Do You Set Resource Requests and Limits in Kubernetes?
Resource requests ensure a minimum amount of resources (CPU/Memory) for a container, while limits enforce the maximum resources a container can consume. This helps with efficient resource allocation and prevents resource contention.
Example:
resources:
requests:
memory: "256Mi"
cpu: "500m"
limits:
memory: "512Mi"
cpu: "1000m
2. Why is Namespace Important in Kubernetes?
Namespaces allow you to partition a single Kubernetes cluster into multiple virtual clusters, providing isolation between different teams or projects. They are useful for managing resource quotas and policies.
Example:
kubectl create namespace dev
3. How Do You Ensure High Availability in Kubernetes?
Use multi-zone clusters with redundant control plane components. Distribute workloads across multiple nodes and regions, ensuring no single point of failure.
Example:
- Deploy an application using a
Deployment
withreplicas
spread across nodes