Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost pods before they are submitted by using a mutating webhook #21

Merged
merged 15 commits into from
Mar 17, 2024

Conversation

norbjd
Copy link
Owner

@norbjd norbjd commented Mar 17, 2024

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:

  • refacto config/ to use kustomize (we need this to inject webhook certificates)
  • deploy controller using a Deployment, and not a Daemonset
  • temporarily disable e2e test on ubuntu-20.04 because of openssl version incompatibility (-CA parameter is unknown on 1.1.1 version included in ubuntu:22.04). I'll reintroduce that later

@norbjd norbjd self-assigned this Mar 17, 2024
@norbjd norbjd merged commit 64e6aa3 into main Mar 17, 2024
2 checks passed
@norbjd norbjd deleted the mutating-webhook branch March 17, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant