Search⌘ K
AI Features

Upgrading Old Pods

Explore how to identify and monitor outdated Kubernetes Pods by querying Prometheus metrics. Learn to create alerts for Pods older than 90 days to ensure your cluster software stays current and resilient. This lesson guides you through practical steps for maintaining up-to-date applications in your Kubernetes environment.

Upgrading our system #

Our primary goal should be to prevent issues from happening by being proactive. In cases when we cannot predict that a problem is about to materialize, we must, at least, be quick with our reactive actions that mitigate the issues after they occur. Still, there is a third category that can only loosely be characterized as being proactive. We should keep our system clean and up-to-date.

Among many things we could do to keep the system up-to-date is making sure that our software is relatively recent (patched, updated, and so on). A reasonable rule could be to try to renew software after ninety days, if not earlier. That does not mean that everything we run in our cluster should be newer than ninety days, but that might be a good starting point. Further on, we might create finer policies that would allow some kinds of applications (usually third-party) to live up to, let’s say, half a year without being upgraded. Others, especially software we’re actively developing, will probably be upgraded much more frequently. Nevertheless, our starting point is to detect all the applications that were not upgraded in ninety days or more.

Detect old applications #

Just as in almost all other exercises in this chapter, we’ll ...