mchinaloy
mchinaloy

Reputation: 1494

Kubernetes Pod Uptime Monitoring

I have a requirement that involves putting together uptime metrics for some of the pods in my Kubernetes cluster.

I am thinking of using the Kubernetes readiness checks and was curious if anyone has done anything similar?

Basically I am trying to generate reports that say this pod has had 95% uptime over the last week/month.

Upvotes: 2

Views: 15071

Answers (3)

Dhruvin
Dhruvin

Reputation: 26

Best is to use time-series database which can store uptime metrics. You can use grafana which as comes first class citizen with k8s cluster roll out if you need.

We use Wavefront to store and visualize this uptime metrics and tons of other metrics. Once you have uptime values available, you will see a sudden drops during pod container down time, prometheus/wavefront/grafan all can then allow you to apply time series functions to see (total uptime / total container down) over specific period of time (month in your case) to reflect what you need

Upvotes: 1

errordeveloper
errordeveloper

Reputation: 6912

I would recommend checking out Prometheus, it is the most powerful way of monitoring internal services of Kubernetes cluster, resource usage (at host level, as well as Kubernetes API level), and, of course, your applications.

NB: for pod uptime, there is a generic up metric you can use.

Upvotes: 1

mchinaloy
mchinaloy

Reputation: 1494

Gave this a bit more thought and we settled on this possible approach:

  1. Deploy a Docker container that executes a BASH script periodically (Cron)
  2. BASH script uses the Kubernetes API Server to discover the pods that need checking
  3. BASH script generates a report that is copied to a mounted directory on the host
  4. This report can then be picked up by another application and processed

Upvotes: 0

Related Questions