-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Deleting a deployment doesn't delete the pods #44046
Comments
We discussed the problem in kubernetes/kubeadm#149 (comment). I'll change the GC to make sure it's cascading. |
Sent #44058 |
Any progress on this? |
Still trying to figure out a sane fix: #44058 (comment) |
I've encountered the same issue. My pods are still running even though I deleted the deployment. |
@caesarxuchao lets come up with a fix for 1.7. This should work from the first time we introduced cascading deletion in Deployments. |
@Kargakis Yes, we should. Do you have any comments on #44058 (comment)? |
@caesarxuchao replied. Let's move this forward. If the fix is small, I am going to backport it to 1.6. |
Offline discussion with @janetkuo, we punt this to v1.8. |
Discussed with @dchen1107, if we can get the PR #45764 fixed soon, it can still go in 1.7. It's a real bug fix. |
Yes, we need to fix this for 1.7 and also backport to 1.6. |
Automatic merge from submit-queue (batch tested with PRs 47492, 47542, 46800, 47545, 45764) delete dependent pods for rs when deleting deployments Fix #44046, where user reported that the garbage collector didn't delete pods when a deployment was deleted with PropagationPolicy=Background.
@liggitt Should this be targeting 1.7? |
yes, the fix that went in in #45764 is going to cause us data issues we don't want |
@Kargakis Are you working on this? What's the timeline to resolution? |
@marun - @caesarxuchao is working on it #44058 |
I approved this for 1.7 based on @liggitt's comment at #44046 (comment). We should revert #45764, but are we ok with @caesarxuchao's #44058 since it also introducing a new behavior. I will leave @kubernetes/sig-apps-bugs to decide. |
#44058 replaces #45764 with a fix that addresses this issue systemically. While this bug did exist in 1.6.x, more things rely on GC in 1.7 than in 1.6, and without that fix, GC leaves more resources vulnerable to unintentional orphaning.
Since the issue is actually with general GC behavior, @kubernetes/sig-api-machinery-bugs should weigh in. |
Automatic merge from submit-queue (batch tested with PRs 44058, 48085, 48077, 48076, 47823) Make background garbage collection cascading Fix #44046, fix #47843 where user reported that the garbage collector didn't delete pods when a deployment was deleted with PropagationPolicy=Background. The cause is that when propagating background garbage collection request, the garbage collector deletes dependents with DeleteOptions.PropagationPolicy=nil, which means the default GC policy of a resource (defined by its REST strategy) and the existing GC-related finalizers will decide how the delete request is propagated further. Unfortunately, the default GC policy for RS is orphaning, so the pods are behind when a deployment is deleted. This PR changes the garbage collector to delete dependents with DeleteOptions.PropagationPolicy=Background when the owner is deleted in background. This means the dependent's existing GC finalizers will be overridden, making orphaning less flexible (see this made-up [case](kubernetes/kubeadm#149 (comment))). I think sacrificing the flexibility of orphaning is worthwhile, because making the behavior of background garbage collection matching users' expectation is more important. cc @lavalamp @Kargakis @krmayankk @enisoc ```release-note The garbage collector now cascades deletion properly when deleting an object with propagationPolicy="background". This resolves issue [#44046](#44046), so that when a deployment is deleted with propagationPolicy="background", the garbage collector ensures dependent pods are deleted as well. ```
Kubernetes 1.6 adds a `PpropagationPolicy` to the delete options, obsoleting the previous `OrphanDependents` boolean. This change sets `PropagationPolicy=foreground`, keeping the legacy `OrphanDependents=false` for older k8s servers. Note that PropagationPolicy=background is broken in k8s 1.6 and (eg) leaks pods from a deployment. See kubernetes/kubernetes#44046 for upstream discussion.
BUG REPORT:
Kubernetes version: 1.6.1
Environment:
What happened:
Deleting a deployment via the API with the DeleteOptions settings
orphanDependants: false
orpropagationPolicy: Background
deletes the Deployment and the replica set but NOT the pods.Deleting it with the DeleteOptions setting
propagationPolicy: Foreground
works as intended.What you expected to happen:
The replica set deletion should propagate to the pods. I've read that the garbage collection should work for Deployments in 1.6.
How to reproduce it:
Anything else we need to know:
I am using the Python Client and at the moment it only supports the orphanDependants option, since it's still at api version 1.5.
The text was updated successfully, but these errors were encountered: