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

Improve usage of resources in Kubernetes #135

Open
worldtiki opened this issue Feb 4, 2021 · 1 comment
Open

Improve usage of resources in Kubernetes #135

worldtiki opened this issue Feb 4, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@worldtiki
Copy link
Collaborator

Describe the feature

The documentation shows an example of how to use Mittens with Kubernetes. The example describes how to setup Mittens as a sidecar, which will send requests to the primary container on the same pod.
This setup will indeed run the warmup process, but it will leave the sidecar running after the warmup completes. There is no actual cpu usage from that point onwards, but the container will still have some cpu and memory allocated to it which could otherwise be used by other pods.

There's been new features added to Kubernetes that may allow us to have a more optimized setup and stop the Mittens container at the end. The goal of this ticket is to find someone willing to spend some time to investigate the different Kube mechanisms (init containers, warmup probes, etc) and propose a better setup 😄

Rational

Less wastage of resources.

@worldtiki worldtiki added the enhancement New feature or request label Feb 4, 2021
@worldtiki worldtiki changed the title Improved usage of resources in Kubernetes Improve usage of resources in Kubernetes Feb 5, 2021
@sumitanvekar
Copy link
Contributor

sumitanvekar commented Sep 15, 2021

Init containers run to completion before the app containers start, so they cannot be used for warm up. https://kubernetes.io/docs/concepts/workloads/pods/init-containers/. If you want to try it out we need to pass -file-probe-enabled=false and -exit-after-warmup=true and not have readinessProbe and livenessProbe sections on the initContainer spec since those are not supported by init containers.

I thought of couple more options:

  • postStart hook - not feasible since we will need to have mittens installed within the app containers which is not desirable.
  • reduce resource request - We can reduce resource request to minimum which keeping limits as today. That way containers will use less resource while it's idle. But it can lead to unexpected edge cases where mittens might not get any resource to run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants