<p>So, we are thinking about switching our production server to Kubernetes. Right now, it's not really professional as it's only one single nginx instance.
99% of the time our server needs to handle about 30 requests a minute, which it easily manages to do.
On <strong>specific times, that we exactly know of in before</strong>, there can be 2000 Users on the same second expecting a service. That is obviously way too much for it and last time it often returned a 502.
Kubernetes Autoscaling seems like a good approach for that. The only problem is that we need the extra containers at that specific time, not 30 seconds after.</p>
<p>So is there a way to &quot;manually&quot; scale? Like telling to Kubernetes to prepare 4 containers at exactly 8 PM MESZ e.g.?</p>

crimbler2
<p>There are a number of way to autoscale Pods in Kubernetes.</p>
<h2>Horizontal Pod Autoscaler</h2>
<p>You can use an <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">Horizontal Pod Autoscaler</a> to scale up Pods reactively, based on metrics. You can also use custom metrics.</p>
<h2>Manually adjust number of replicas</h2>
<p>You can also manually set the number of <code>replicas:</code> in the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Deployment</a>. This can be done <em>declaratively</em> by changing the manifest, or <em>imperatively</em> by using kubectl:</p>
<pre><code>kubectl scale deployment my-app --replicas=5
</code></pre>
<h2>Use a CronJob to adjust the number of replicas</h2>
<p>You can also use a Kubernetes <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="nofollow noreferrer">CronJob</a> with a kubectl-image that does the command above to scale up number of replicas at a specific time.</p>
<h2>Use Knative Serving Autoscaler to autoscale per request</h2>
<p>When using Knative Serving, you can use the <a href="https://knative.dev/docs/serving/autoscaling/concurrency/" rel="nofollow noreferrer">Knative Service Autoscaler</a> to scale up based on the number of requests.</p>
