<p>I'm currently learning Kubernetes and I'm facing a problem with trying to realize a concept using Kubernetes.</p>
<p>I'm looking for something that works like a <code>ReplicationController</code> where I can tell K8s to start 50 replicas. But when I reduce the amount of replicas I need K8s to wait for the pods to terminate by themselves.</p>
<p>I know that there are <code>Job</code>s but from what I've read it doesn't seem to be the fitting solution, since jobs are kind of a one-time thing. I need to keep the amount of desired pods until I decrease the amount of desired pods.</p>
<p>Basically a behavior like this:<br />
<a href="https://i.stack.imgur.com/ky9hl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ky9hl.png" alt="controllerBehavior" /></a></p>

MysteriousPerson
<p>You can use the kind <strong>Deployment</strong> in background it uses the ReplicationController and ReplicaSets.</p>
<p>ReplicationController is old version while the ReplicaSets is an updated approach to use. In background Kind : Deployment uses.</p>
<p>You can run the number for desired replicas by setting the numbers into the YAML file.</p>
<p>when you scale the deployment it will spin up the number of replicas and at the time of termination, you can again pass the desired replicas.</p>
<p>For example :</p>
<pre><code>kubectl scale deployment test-deployment --replicas=50
</code></pre>
<p>Now running replicas are 50 and you want to scale down</p>
<pre><code>kubectl scale deployment test-deployment --replicas=40
</code></pre>
<p>You can also check out the HPA</p>
<p><a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/</a></p>
