From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Cleaning up resources

Cleaning up resources

- Particularly, when you are learning Kubernetes, you might be interested in cleaning up your resources, because that doesn't happen automatically. So some resources have options for automatic cleanup if they are no longer used. When you learn a Pod, for instance, you can use a --rm option to automatically remove it. For other resources, you will need to periodically manually clean them up. Now, if a Pod is managed by deployments, the deployment must be removed, not the Pod, and that's a generic rule. If you have a resource that creates another resource like we have seen in the case of the CronJob, you delete the top-level resource and then everything else will be deleted. If you delete the lower level resource, it'll automatically be created again. Now, there are options to force delete a resource. That's not a good idea. I would advise against them. Don't do it because it might bring your resources in an unmanageable state. What you should think of, well think about you have a…

Contents