-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
PodEvict API does not trigger Pod deletion callback when DeleteOptions is set to metav1.NewDeleteOptions(0) #124018
Comments
kubernetes v1.20 is not a support version, and a better place to ask would be on the support channels. please see: /kind support |
/sig api-machinery |
The webhook has to intercept the pods/eviction CREATE operation if it wants to observe this. Eviction can trigger force deletion with |
thanks~ btw, where is the request for a resource to mention this scenario? |
also, I've found that setting the same Options when calling pod delete API can triggers pod delete webhook if err := cli.CoreV1().Pods("default").Delete(context.Background(), "pod-xxx", *metav1.NewDeleteOptions(0)); err != nil {
glog.Panicln("delete pod error:", err)
} |
The admission webhook is intercepting the request that is made. In that case, a delete request is made on the pods resource, so admission registered for that endpoint+operation is called. When making an eviction request to the eviction subresource with options that immediately remove the pod object, no explicit delete API call is made to the pods endpoint. |
/triage accepted |
What happened?
当我使用client-go组件的Evict API时,发现当设置了 DeleteOptions 为 metav1.NewDeleteOptions(0) 时,无法触发mutating webhook的Pod 删除回调, 当我不设置 DeleteOptions 时,可以正常触发
代码如下:
mutatingwebhookconfiguration:
What did you expect to happen?
我期望Evict API在设置了 DeleteOptions 为 metav1.NewDeleteOptions(0) 时,能够正常触发mutatingwebhook的Pod删除回调。
How can we reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
No response
Install tools
No response
Container runtime (CRI) and version (if applicable)
No response
Related plugins (CNI, CSI, ...) and versions (if applicable)
No response
The text was updated successfully, but these errors were encountered: