Recommended way to use telegraf for kubernetes

Hello,

I have been running telegraf with inputs.docker within kubernetes for about 20 months. This is almost perfect. However, when having short running pods like kubernetes-cronjobs (sometimes their lifetime is only some seconds), the plugin does not get their metrics. (see Question about telegraf: docker-container-status / exitcode for details)

Actually, I am searching for the recomended way to get the “real” kubernetes-metrics.

I find the inputs.kubernetes-plugin and I am wondering how to get the token from kubernetes. Other docs like https://github.com/influxdata/helm-charts/blob/master/charts/telegraf/values.yaml do not use the inputs.kubernetes-plugin.

I have a k8-cluster with one master and three nodes (workers).

Looking forward to your tips. Thanks.

Ok, just found https://github.com/influxdata/helm-charts/blob/master/charts/telegraf-ds with https://github.com/influxdata/helm-charts/blob/master/charts/telegraf-ds/templates/role.yaml and got it running.

However, there are very little metrics compared with inputs.docker.

What is the recommended way to get metrics from kubernetes without running docker - e.g. with https://k3s.io ?

1 Like