| Users/Workloads | What Changes |
|---|---|
| 100 users | Single Kubernetes cluster with a few nodes; simple deployments; manual scaling |
| 10,000 users | More nodes added; use of Horizontal Pod Autoscaler; introduction of namespaces for isolation |
| 1,000,000 users | Multiple clusters; cluster federation or multi-cluster management; advanced networking; use of ingress controllers and service meshes |
| 100,000,000 users | Global multi-region clusters; automated cluster provisioning; heavy use of monitoring, logging, and security policies; advanced autoscaling and resource optimization |
Kubernetes basics review in Microservices - Scalability & System Analysis
Start learning this pattern below
Jump into concepts and practice - no test required
At small scale, the first bottleneck is the control plane of Kubernetes. It manages the cluster state and schedules pods. With increasing workloads, the API server and scheduler can become overwhelmed.
Also, the etcd database that stores cluster state can become a bottleneck if too many updates happen rapidly.
- Control Plane Scaling: Use managed Kubernetes services or run highly available control plane nodes to distribute load.
- Horizontal Pod Autoscaling: Automatically scale pods based on CPU or custom metrics.
- Cluster Federation: Manage multiple clusters to distribute workloads geographically.
- Namespace and Resource Quotas: Isolate workloads and prevent resource contention.
- Use of Ingress Controllers and Service Meshes: Efficient traffic routing and observability.
- Monitoring and Logging: Use tools like Prometheus and Fluentd to track cluster health and performance.
Assuming 10,000 concurrent users generating 100 requests per second (RPS):
- API Server handles ~1000-5000 concurrent connections; may need multiple replicas.
- Each node can run hundreds of pods; adding nodes increases capacity linearly.
- Network bandwidth depends on pod communication; 1 Gbps network can handle ~125 MB/s.
- Storage for logs and metrics grows with number of pods; consider retention policies.
When discussing Kubernetes scalability, start by explaining the cluster components and their roles.
Identify the control plane as a potential bottleneck early on.
Discuss horizontal scaling of nodes and pods, and how autoscaling helps.
Mention multi-cluster strategies for very large scale.
Always relate solutions to specific bottlenecks you identify.
Your Kubernetes API server handles 1000 QPS. Traffic grows 10x to 10,000 QPS. What do you do first?
Answer: Scale the control plane by adding more API server replicas or move to a managed Kubernetes service with a highly available control plane to handle increased load.
Practice
pod in Kubernetes?Solution
Step 1: Understand Kubernetes resource types
Kubernetes groups containers into pods to run them together on the same host.Step 2: Identify the role of a pod
A pod is the smallest deployable unit that can contain one or more containers sharing resources.Final Answer:
The smallest unit that runs one or more containers together -> Option BQuick Check:
Pod = smallest container group [OK]
- Confusing pods with kubectl tool
- Thinking pods are config files
- Mixing pods with network policies
Solution
Step 1: Recall kubectl commands for listing resources
The standard command to list pods iskubectl get pods.Step 2: Check other options for correctness
kubectl list podsandkubectl show podsare invalid commands;kubectl describe pods allis incorrect syntax.Final Answer:
kubectl get pods -> Option AQuick Check:
List pods = kubectl get pods [OK]
- Using 'list' or 'show' instead of 'get'
- Adding unnecessary arguments like 'all'
- Confusing describe with get
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
spec:
containers:
- name: myapp-container
image: nginx:latest
ports:
- containerPort: 80
What will kubectl get pods myapp-pod show after creation?Solution
Step 1: Understand pod creation from YAML
The YAML defines a pod with one container running nginx, exposing port 80.Step 2: Predict pod status after creation
Immediately after creation, the pod should be running with 1 container ready, so status is Running and READY is 1/1.Final Answer:
NAME READY STATUS RESTARTS AGE myapp-pod 1/1 Running 0 0s -> Option DQuick Check:
Pod created and running = READY 1/1 Running [OK]
- Expecting Pending status without reason
- Confusing Completed with Running
- Assuming pod not found immediately after creation
kubectl apply -f pod.yaml but get an error: "error: unable to recognize \"pod.yaml\": no matches for kind \"Pod\" in version \"v2\"". What is the likely fix?Solution
Step 1: Analyze the error message
The error says no matches for kind "Pod" in version "v2", meaning the apiVersion is invalid.Step 2: Correct the apiVersion in YAML
The correct apiVersion for Pod is "v1", so changing from "v2" to "v1" fixes the issue.Final Answer:
Change apiVersion from v2 to v1 in pod.yaml -> Option CQuick Check:
apiVersion must be valid (v1 for Pod) [OK]
- Changing file extension instead of apiVersion
- Running with sudo unnecessarily
- Deleting file without fixing content
nginx:1.19 to nginx:1.21 without downtime. Which Kubernetes resource and method should you use?Solution
Step 1: Understand pod immutability and updates
Pods are immutable; you cannot update container images directly on running pods without recreating them.Step 2: Use Deployment for zero downtime updates
Deployments manage pods and allow rolling updates to change images without downtime usingkubectl set image.Final Answer:
Create a Deployment and update its image withkubectl set image-> Option AQuick Check:
Use Deployment + set image for smooth updates [OK]
- Trying to edit pod image directly
- Deleting pod causes downtime
- Scaling pod is invalid command
