-
Notifications
You must be signed in to change notification settings - Fork 192
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
Deployment Delete #62
Comments
Does this work for you? k8s.group(deployment).ns.deployments.delete({
name: deployment.metadata.name,
qs: { orphanDependents: false }
}); Since this is a recent feature, and might be Alpha on the version of kubernetes you're running, ensure you're running with it explicitly enabled. In the past kubectl implemented this cleanup client side (e.g., set replicas to 0, then delete the resource), so I'd expect cleanup behavior if you're using kubectl, regardless of your kubernetes version. Our README.md had a typo, which might have been misleading (#63) I created an issue for your |
Hey @silasbw thanks for the quick reply. I tried what you suggested above:
Resulting in:
Minikube v0.14.0 Changelog: TL;DR -> K8s version 1.5.1. So deployment should be available.
Ah, that makes more sense. I was wondering if there was some kubectl magic that wasn't happening via the API. If that is the case, then I 3 callbacks will have to suffice for now. Thank you for updating the docs!
Sweet, thank you very much. If I get some time, perhaps I could find a way to put something together. Thank you again for your quick feedback! |
I'd expect |
I'm going to close -- re-open if it you suspect a bug with kubernetes-client, or you have an ask a feature. |
Ah, ok, I see what you mean now. I will check on that. Thanks for the suggestion.
👍 sounds good. Thanks for your feedback. |
After looking at the k8s docs on
deployment delete
, it seems like passingorphanDependents: false
should delete "everything" associated with the deployment.Currently, I am trying to use the
kubernetes-client
api to accomplish full deletes of items associated with a deployment. For example, when using the following api:I would expect the above to delete an already existing deployment with the given deployment
name
, and allpods
, andreplicasets
. However, the observed behavior is that thedeployment
does get deleted, though thepods
andreplicasets
are orphaned (i.e. not deleted). If you run akubectl delete deployment <deployment_name>
, by default, all resources associated with the deployment will be deleted.Perhaps you could let me know if I'm using the api wrong, or if
kubernetes-client
does not support this.What I'm trying to avoid is having to have 3 callbacks, each deleting one of the above resources, in order to create a deployment with the same
name
.Another nicety would be being able to do something like
kubectl apply -f
, programatically. So instead of seeing,Error: deployment "insert_deployment_name_here" already exists
, it would just overwrite with the new config. However, I may have yet again misread the docs.Any help is appreciated! Thanks for maintaining this project, its helped a lot and has allowed me to not have to write my own library to do exactly this. 👍 x 💯
The text was updated successfully, but these errors were encountered: