Exploring Jenkins X Garbage Collection
Explore how Jenkins X handles the garbage collection of preview environments created from pull requests. Understand the role of Kubernetes CronJobs that periodically remove outdated activities, pods, and previews, ensuring efficient resource management without manual intervention. Learn how to verify and manually trigger garbage collection if needed while maintaining focus on other development tasks.
We'll cover the following...
It would be silly for each preview environment to run forever. We need to figure out how to remove everything deployed as part of the pull request process for those that are already merged or closed. We could manually delete previews, but that would result in too much human involvement in something repetitive and predictable. We could create a script that would do that for us that would be executed periodically, but before we do that we should check whether Jenkins X already has some Kubernetes CronJobs.
Getting Kubernetes CronJobs
The output is as follows.
At the time ...