-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Don't block scale down on pods owned by custom controllers #5387
Comments
@x13n: The label(s) `/label cluster-autoscaler
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@vadasambar Are you still planning an approach for this or can I pick it up? |
Thank you for noticing I was looking at this issue. I am new to cluster-autoscaler code. I have an understanding of the problem. I am trying to solidify my approach which goes something like this:
As of now, I am trying to figure out a way to do 2 in a nice way. If you have any feedback on the approach, I would love to know more (I am not sure if my approach is the best way to solve the problem). As for the ticket, if this ticket needs to be worked on urgently (or you are stuck because of it), feel free to pick it up. I might continue looking at it in the background to see if my solution matches yours in the end (not necessarily for raising a PR but more for understanding). P.S.: I don't think we will need listers at all. I might have misunderstood the problem. We just need to treat anything with owner reference as replicated. |
Using a lister is an extra layer of safety - to ensure not just that the pod is owned, but also that the owner didn't disappear in the meantime. |
That makes sense. Thank you for the feedback!
This doesn't sound true anymore. Having a generic lister does have value. It makes sense to use the listers and query for owners like our existing code does but for a wider range of owner types (not limited to the built-in types like Jobs, Statefulsets, Deployments etc.,) |
Which component are you using?:
/label cluster-autoscaler
Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:
As the k8s ecosystem grows, a hardcoded list currently used by CA is not going to work with custom controllers. In
autoscaler/cluster-autoscaler/utils/drain/drain.go
Line 76 in ee66755
controller: true
as replicated. In case of controllers that do not recreate evicted pods, existing annotations could be used (cluster-autoscaler.kubernetes.io/safe-to-evict
:false
orcluster-autoscaler.kubernetes.io/daemonset-pod
:true
) to prevent CA from evicting such pods.Describe the solution you'd like.:
Just look at
controller
field in owner references and treat all controller-owned pods as replicated by default.Describe any alternative solutions you've considered.:
Add some extension mechanism (CRD?) allowing CA to know how to handle specific controllers. This might be useful in the long term, but will require much more work.
Additional context.:
The text was updated successfully, but these errors were encountered: