I want to run containers locally in a Kubernetes-like environment so I can test how a service behaves when scaled up. Is there a practical way to create a local cluster, run multiple replicas, configure resource limits, and generate traffic for basic scalability testing? I'm also interested in understanding the limitations of local testing compared with a real multi-node production cluster.
4 Answers
Use a local Kubernetes distribution such as Minikube or kind. They run an actual Kubernetes cluster locally, so you can deploy your workloads, increase the number of pod replicas, set CPU and memory requests or limits, and send test traffic to the service. This is generally more useful than trying to mock the containers themselves.
First define what ‘scaling’ means for your service. Kubernetes can scale replicas based on CPU or memory, while systems using queue depth or custom metrics may need something such as an event-driven autoscaler. You should also account for how quickly new nodes become available, how long images take to pull, and whether the application itself can handle concurrent requests.
A local cluster can help verify configuration, scheduling, service discovery, and basic replica behavior, but it is not a reliable measure of production scalability. Minikube and many kind setups run on one machine, so the CPU, memory, networking, storage, and node-provisioning behavior will differ from a real multi-node environment. Use a load generator for rough testing, then run serious capacity tests on infrastructure that resembles production.
If the goal is local debugging with real cluster traffic rather than capacity testing, a proxying tool can route traffic from Kubernetes to a service running on your machine. Traffic mirroring through a service mesh is another option when you want to exercise the service against realistic infrastructure without replacing the production path.

That sounds like the cleanest approach. I mainly want to validate the deployment and replica behavior before testing on a larger cluster.