Boost pods before they are submitted by using a mutating webhook #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, all the boosting logic is inside the controller. The controller listens for pods creations/updates, so pods are boosted after their creation.
In some cases, the boost can't be applied properly (e.g. boosting from 1 CPU to 10 CPU if the initial pod is scheduled on a 4-CPU node won't work). So, we need to boost before the pod is actually submitted to k8s API. Mutating webhook can solve this issue.
When submitting a pod with
norbjd.github.io/k8s-pod-cpu-booster-enabled: "true"
label, the webhook will now change the CPU requests and limits. Once submitted to the k8s API (with that boost), pod will start normally until it's ready.After the pod is ready, the controller will still be useful to remove the pod boost. The "unboosting" logic in the controller remains unchanged. But now, the controller will only take care of this "unboosting" logic.
Other notable changes:
config/
to use kustomize (we need this to inject webhook certificates)Deployment
, and not aDaemonset
ubuntu-20.04
because ofopenssl
version incompatibility (-CA
parameter is unknown on1.1.1
version included in ubuntu:22.04). I'll reintroduce that later