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

Cascading Deployment Removal #162

Closed
InAnimaTe opened this issue Mar 29, 2017 · 15 comments
Closed

Cascading Deployment Removal #162

InAnimaTe opened this issue Mar 29, 2017 · 15 comments

Comments

@InAnimaTe
Copy link

When calling delete_namespaced_deployment, even with orphaned_dependents (which doesn't mean I think it means), only the deployment object itself gets removed. This means you've got the ReplicaSet and 1 or more Pods still running.

Between garbage collection and ReplicaSet references to the Deployment that created it, there still doesn't seem to be a way to have a delete cascade properly.

Kinda wondering how others are solving the problem and if maybe there needs to be more development in this area either here or upstream. Merely trying to provide a reliable removal function in my application...

@TracyBin
Copy link

sorry for wrong reply. you are right.orphaned_dependents takes no effect

@mbohlool
Copy link
Contributor

doesn't look like a python client issue. More like an upstream feature request. can you do delete cascade with kubectl? If yes, you can use -v9 with kubectl to see what APIs are called.

@InAnimaTe
Copy link
Author

InAnimaTe commented Mar 31, 2017 via email

@vascofg
Copy link

vascofg commented Apr 4, 2017

I'm having this same issue, and after further investigation have found out that the current (1.6.1) way of doing this is with the parameter propagationPolicy on the DeleteOptions:
k8s documentation

It seems the python client doesn't support this ATM:
v1_delete_options.py

When can we expect this feature to be implemented?

@mbohlool
Copy link
Contributor

mbohlool commented Apr 7, 2017

Can you guys give 2.0.0a a try. I've updated python client.

@vascofg
Copy link

vascofg commented Apr 8, 2017

I've tried it, working fine for my application, at least the new options I needed in v1_delete_options.py are working fine.

@djkonro
Copy link
Contributor

djkonro commented Jun 12, 2017

@vascofg ,Please I tried the function call below, but I was still unable to archive cascading deletion. Can you help me understand what I am not doing right?

extensions.delete_namespaced_deployment(name='nginx-deployment', namespace='default', body=client.V1DeleteOptions(),grace_period_seconds = 56, propagation_policy = \"Background\")

@vascofg
Copy link

vascofg commented Jun 13, 2017 via email

@djkonro
Copy link
Contributor

djkonro commented Jun 13, 2017

@vascofg, I have also tried Foreground but it still deletes only the deployment and not it dependents.

@vascofg
Copy link

vascofg commented Jun 13, 2017

I think your error is when creating DeleteOptions, try passing parameters to the object constructor, mine looks like this:

client.V1DeleteOptions(propagation_policy="Foreground", grace_period_seconds=5)

Hope it helps

@djkonro
Copy link
Contributor

djkonro commented Jun 13, 2017

I have tried extensions.delete_namespaced_deployment(name='nginx-deployment', namespace='default', body=client.V1DeleteOptions(propagation_policy="Foreground", grace_period_seconds=5)), but I am still getting the same result (pods are not deleted). Thanks alot for the help.

@vascofg
Copy link

vascofg commented Jun 13, 2017 via email

@djkonro
Copy link
Contributor

djkonro commented Jun 13, 2017

No, the replicaset is not deleted.

@vascofg
Copy link

vascofg commented Jun 13, 2017 via email

@djkonro
Copy link
Contributor

djkonro commented Jun 13, 2017

@vascofg, Thanks very much, I just updated my version for Kubernetes and it now works fine.

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

5 participants