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

v1beta1/deployment: delete dependents #50

Closed
josselin-c opened this issue Dec 7, 2016 · 2 comments
Closed

v1beta1/deployment: delete dependents #50

josselin-c opened this issue Dec 7, 2016 · 2 comments

Comments

@josselin-c
Copy link

When removing a deployment I'd like the related replicaset/pods to be removed as well (this is the cascading mode in kubectl).

I tried to call Deployments("ns").Delete with the OrphanDependents option set to true or false but it didn't seem to do anything.
How can I do the cascading delete with client-go?

@caesarxuchao
Copy link
Member

It's not supported yet. Currently cascading deletion is only supported for replicaset/replication controller (i.e., after you delete the rs or rc, the garbage collector controller will delete the pods). Cascading deletion of deployment will be supported after this PR gets merged: kubernetes/kubernetes#35676

As a workaround, you can take a look how kubectl deletes a deployment: https://github.com/kubernetes/kubernetes/blob/v1.6.0-alpha.0/pkg/kubectl/stop.go#L415. Basically it first scales down (supported in client-go) the deployment, waits the deployment.status reports the replicas reaches 0, and then delete the deployment.

@josselin-c
Copy link
Author

Okay, I'll do this then and keep an eye on the PR.
Thanks for the help!

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

2 participants