Menu

Kubernetes Has Garbage Collection. Why Did We Build Another One?
📰

Kubernetes Has Garbage Collection. Why Did We Build Another One?

DEV Community: kubernetes·Zen Mesh Inc.·about 5 hours ago
#qX8U9AMM
#devtokubernetes#devto#dev#kubernetes#article
Reading 0:00
15s threshold

This is article 2 of 10 in Beyond Kubernetes Defaults . Read article 1: When Kubernetes Primitives Aren’t Enough first. This article is cross-published from Zen Mesh .

Kubernetes already garbage-collects resources.

That makes “we built a Kubernetes garbage collector” sound suspiciously like reinventing a solved problem.

In many cases, it would be.

Kubernetes gives us several excellent lifecycle mechanisms: owner references , cascading deletion, Job TTLs , CronJob history limits and finalizers . If a resource has a natural owner or a single lifecycle rule, those mechanisms should usually be the first choice.

Our need appeared when cleanup stopped being a property of one resource and became policy across resource classes.

Native cleanup is good at structural lifecycle

Owner references are excellent when the relationship is structural: delete the parent and its children should disappear.

ttlSecondsAfterFinished is excellent when every completed Job can follow the same lifecycle.

CronJob history limits…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.