openkruise / kruise

Automated management of large-scale applications on Kubernetes (incubating project under CNCF)
https://openkruise.io
Other
4.61k stars 760 forks source link

[feature request] workloadspread 支持 cr 给 pod 打 pod-deletion-cost 标 #1744

Open ermazi opened 2 weeks ago

ermazi commented 2 weeks ago

ws === workloadspread pdc === pod-deletion-cost

What would you like to be added: cr 支持打 pdc 标 Why is this needed: ws 依赖 pdc ,现在 ws 不支持给 cr 打 pdc 标, 缩容没法保证 pod 满足约束

求支持:DDDD

furykerry commented 2 weeks ago

workloadspread can only annotate related pods with deletion cost, but workloadspread cannot guarantee that the actual deletion sequence which is controlled by the controller behind the customized resource

ermazi commented 2 weeks ago

workloadspread can only annotate related pods with deletion cost, but workloadspread cannot guarantee that the actual deletion sequence which is controlled by the controller behind the customized resource

Just need annotate pods. As for whether CR supports the pod-deletion-cost feature, that's CR's responsibility.

ermazi commented 2 weeks ago

比如我们的场景, cr 控制 多个 dp, versionedmap就是 pod-template-hash -> pod 的映射; 获取最新版本, 就通过 cr 的status 字段, 获取当前最新版本呢, 然后 ref查到 dp, 再找到 rs , 获取最新的 rs pod-template-hash 作为最新版本, 从而进行 pdc 打标 --trans-- For example, in our scenario, the CR controls multiple DP, and the VersionedMap is the mapping from pod-template-hash to pods. To get the latest version, you would check the status field of the CR to find the current latest version, then use the reference to locate the DP, and from there find the RS. Obtain the latest pod-template-hash from the newest RS as the latest version, and then proceed with PDC labeling.