<p>I've got a bunch of Java (spring boot) microservices that require <strong>a lot</strong> of CPU when booting compared to when they are done starting up. I need at least 400m to get my pod started within 5minutes, where afterwords my pods only use on average 10m.</p>
<p>I'm a bit in doubt what now is a wise strategy. I'm deliberately not setting CPU limits, but previously have set my CPU requests pretty low (20m). If an entire node get's evicted, pods get the minimal amount of CPU and aren't able to successfully startup (obviously if only 1 pod boots there is now problem). If I schedule all my microservices with 400m I'll have a huge amount of unused resources when nothing is really happening.</p>
<p>Is there a way for Kubernetes to be less strict on resource requests, provisioning more pods than strictly allowed when taking the sum of my requests?</p>
<p>The answer in the <a href="https://stackoverflow.com/questions/60967380/startup-cpu-limit-for-java-applications-in-kubernetes">following question</a> suggests to just remove CPU limits (what I'm already doing), so I guess they would suggest you should give your pods the &quot;low&quot; amount of CPU requests. Then pods can get scheduled with too little resources to startup, moving into a crashloop, wouldn't that be an anti pattern?</p>

hY8vVpf3tyR57Xib
<p>You could consider using a <a href="https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler" rel="nofollow noreferrer">Vertical Pod Autoscaler</a> which adjusts the CPU and memory based on visible usage. So you could ask for a lot of memory and CPU up front and the VPA should reduce those later over time.</p>
<p>YMMV though, I've never used it with a spring boot app, but give it a go and see if it works for you.</p>
