Yonah Dissen
Yonah Dissen

Reputation: 1305

Grafana shows dead kubernetes pods from influxdb

I'm using grafana heapster influxdb to monitor my kubernetes cluster and when I go into the pods section in the dashboard I need to sort through many pods which are no longer running.

How can I eliminate these pods from the database or at least make my template filter out these pods?

Thanks in advance

Upvotes: 0

Views: 485

Answers (1)

Yonah Dissen
Yonah Dissen

Reputation: 1305

You can add on the influxdb a retention policy :

CREATE RETENTION POLICY "2hours" ON "k8s" DURATION 2h REPLICATION 1

CREATE CONTINUOUS QUERY current_pods_query ON k8s BEGIN SELECT max(value) AS value INTO k8s."2hours".current_pods FROM k8s."default".uptime WHERE type = 'pod' GROUP BY time(5m), namespace_name, nodename, pod_name END

After this update your grafana template

Upvotes: 0

Related Questions