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 helm-charts/values.yaml at master · influxdata/helm-charts · GitHub 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 helm-charts/charts/telegraf-ds at master · influxdata/helm-charts · GitHub with helm-charts/role.yaml at master · influxdata/helm-charts · GitHub 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