<p>Kubernetes CPU manager provides a way to configure CPU resource limit <a href="https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#cpu-management-policies" rel="nofollow noreferrer">statically</a>. However, in some cases it could lead to a waste of cluster resources, for example an application could require significant CPU during its startup, later on allocated resources are not required anymore and it makes sense to optimize CPU in such case and lower CPU limit. I think Kubernetes doesn't provide a support for such scenario as of today, I am wondering if there is any workaround to address this issue, the CPU manager relies on <a href="https://www.kernel.org/doc/html/latest/scheduler/sched-bwc.html" rel="nofollow noreferrer">CFS</a>, technically wouldn't be possible to modify system configuration (<code>cpu.cfs_quota_us</code> for instance), dynamically after pod creation by Kubernetes using initial CPU limits?</p>

Rafik EL YAAGOUBI
<p>You can use VerticalPodAutoscaler to achieve this. You'll need to define a CustomResource for this that details which pods to target and the policy to use:
example:</p>
<pre><code>apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-app-vpa
spec:
  targetRef:
    apiVersion: &quot;apps/v1&quot;
    kind:       Deployment
    name:       my-app
  updatePolicy:
    updateMode: &quot;Auto&quot;
</code></pre>
<p>More details on installing and using VPA: <a href="https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler" rel="nofollow noreferrer">https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler</a></p>
