<p>I want to create something similar with this:</p>
<p><a href="https://i.stack.imgur.com/Gs92A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gs92A.png" alt="enter image description here" /></a></p>
<p>Basically I have a microservice and I want to scale the instances of it, but to use the same MongoDB container. These containers should be connected to a load balancer. How can I achieve this using Kubernetes?</p>

George Valentin
<p>You can use k8s <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/" rel="nofollow noreferrer">HorizontalPodAutoscaler</a> to scale out your microservice as the demand goes up. When all of your nodes are filled up with microservices, you use <a href="https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler" rel="nofollow noreferrer">cluster autoscaler</a> to scale out your node so more microservices can come online.</p>
