How Can I Scale Down Specific Pods in Kubernetes Based on CPU Usage?

0
2
Asked By CuriousCat42 On

Hey everyone! We have a unique requirement for managing our pods. We want to keep Horizontal Pod Autoscaler (HPA) active, but instead of allowing it to randomly scale down pods, we want to specifically scale down those pods that are no longer running calculations. The calculations can take up to 20 minutes, and I've found that neither Kubernetes HPA nor KEDA can handle this situation. Has anyone here created a Custom Pod Controller to tackle this issue? Any insights would be greatly appreciated! Thanks!

5 Answers

Answered By ResourceWizard On

Have you thought about trying out any resource management platforms with free trials? I can't speak for all of them, but I know ScaleOps can scale workloads based on various factors and detailed policies. You might find it helpful to check it out!

Answered By CuriousCat42 On

Thanks for the recommendation! I'll definitely explore that option.

Answered By TechieTina On

It sounds like what you're really trying to do is schedule jobs. Have you looked into how Kubernetes jobs work? You can set up a job template and trigger it based on certain events. That might be the solution you need! 😊

CuriousCat42 -

Absolutely, I was a bit blind to that option. Thanks for the suggestion!

Answered By CodeNinja99 On

If your application has a component for calculations and another part that needs to run continuously, consider separating them into different pods. Like TechieTina mentioned, use Kubernetes Jobs for the calculation tasks and keep the other part as a Deployment.

Answered By CloudGuru On

You might want to check out KEDA's ScaledJobs. It's great for scaling based on event triggers. If you’re using Kafka, it should simplify triggering those scaled jobs for your calculations.

TechieTina -

Good point! Since we're using Kafka, it should make triggering the scaled jobs quite straightforward.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.