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

Add step to edit pod annotation controller.kubernetes.io/pod-deletion-cost before scaling. #175

Open
LQBing opened this issue Aug 10, 2022 · 3 comments
Assignees

Comments

@LQBing
Copy link

LQBing commented Aug 10, 2022

Is your feature request related to a problem? Please describe.

The different pods of an application could have different utilization levels. On scale down, the application may prefer to remove the pods with lower utilization. This works if the application itself controls the down scaling; for example, the driver pod of a Spark deployment.

Kubernetes v1.22 added a new annotation controller.kubernetes.io/pod-deletion-cost` for pod. But I don't know how to add a step to reorder pod-deletion-cost in CPA.

Describe the solution you'd like

Adding a step allows me to customize the sorting pod-deletion-cost action before scaling.

Additional context

https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-deletion-cost

https://kubernetes.io/docs/reference/labels-annotations-taints/#pod-deletion-cost

@jthomperoo jthomperoo self-assigned this Sep 16, 2022
@jthomperoo
Copy link
Owner

I think this is a great idea - I had previously looked at something similar to this but couldn't find any way to do it with Kubernetes, but as your links show it looks like that's changed with Kubernetes v1.22. I've assigned this to myself to investigate what the work would be to implement this. Thanks for raising this!

@lyudmilalala
Copy link

Want to quickly ask that, if I want to take advantage of the pod-deletion-cost, is it workable to set the pod's pod-deletion-cost by myself in my own application?
In my understanding, CPA just help me to customize my logic of determining the number of replicas to scale, so when k8s really take the deletion action, it will still consider the pod-deletion-cost. I have not finish reading the code of the CPA operator yet, so please correct me if I am not on the right way.

@jthomperoo
Copy link
Owner

Hi @lyudmilalala that's correct, you should be able to set the pod-deletion-cost yourself, the CPA will just interface with Kubernetes scaling APIs for adjusting replica counts, so this shouldn't overwrite any modifications you make, and the scaling API should respect these pod-deletion-costs.

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

No branches or pull requests

3 participants