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

When deleting yaml files, k8s_yaml should delete the related resources #3137

Closed
rhyek opened this issue Mar 27, 2020 · 3 comments · Fixed by #4700
Closed

When deleting yaml files, k8s_yaml should delete the related resources #3137

rhyek opened this issue Mar 27, 2020 · 3 comments · Fixed by #4700
Labels
enhancement New feature or request

Comments

@rhyek
Copy link

rhyek commented Mar 27, 2020

I might be missing something from the documentation, but couldn't find any related entries or github issues.

My current workflow is basically I am writing all my infrastructure as code with Pulumi with the option to output the build as yaml files during local development. Tilt is reading some of those yaml files using k8s_yaml. Whenever I delete a k8s resource within Pulumi and rebuild, the yaml file will be removed. I expect Tilt to handle this event and delete the corresponding resource from my cluster.

Currently I have to delete those resources manually using kubectl and this is not ideal.

@nicks
Copy link
Member

nicks commented Mar 27, 2020

Yes. I agree this is something we should do. We've talked about it a little in some other places (e.g. #3035). But this is a much better description of the problem I've heard in other places, so I'm going to leave this as the tracking ticket for this feature. Thanks for the request!

For now, one thing I've seen people do is kubectl get deployments -l "app.kubernetes.io/managed-by=tilt" (to get all the deployments that Tilt created, so that they can delete them)

@nicks nicks added the enhancement New feature or request label Mar 27, 2020
@rhyek
Copy link
Author

rhyek commented Mar 27, 2020

Thanks. In my case that workaround wouldn't work, because I still want to keep the other resources I didn't delete running.

Glad you're interested in the feature.

@milas
Copy link
Contributor

milas commented Jun 29, 2021

As of v0.21.0, Tilt will clean up unreferenced K8s resources on Tiltfile update.

Please note that this only applies to resources Tilt previously deployed for the given tilt up invocation that are no longer referenced. That is, Tilt will NOT clean up resources that it deployed from a previous tilt up invocation at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants