From e6a87cd52e5f731ac26b2824c88faab0b3f55d34 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 12 Dec 2019 15:01:50 -0800 Subject: [PATCH] Update kubernetes sample config and readme --- plugins/inputs/kubernetes/README.md | 10 +++++++--- plugins/inputs/kubernetes/kubernetes.go | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/inputs/kubernetes/README.md b/plugins/inputs/kubernetes/README.md index 2a286e962..2d38f23d9 100644 --- a/plugins/inputs/kubernetes/README.md +++ b/plugins/inputs/kubernetes/README.md @@ -1,6 +1,10 @@ # Kubernetes Input Plugin -This input plugin talks to the kubelet api using the `/stats/summary` and `/pods` endpoint to gather metrics about the running pods and containers for a single host. It is assumed that this plugin is running as part of a `daemonset` within a kubernetes installation. This means that telegraf is running on every node within the cluster. Therefore, you should configure this plugin to talk to its locally running kubelet. +The Kubernetes plugin talks to the Kubelet API and gathers metrics about the +running pods and containers for a single host. It is assumed that this plugin +is running as part of a `daemonset` within a kubernetes installation. This +means that telegraf is running on every node within the cluster. Therefore, you +should configure this plugin to talk to its locally running kubelet. To find the ip address of the host you are running on you can issue a command like the following: @@ -44,8 +48,8 @@ avoid cardinality issues: ## OR # bearer_token_string = "abc_123" - # Labels to include and exclude - # An empty array for include and exclude will include all labels + ## Pod labels to be added as tags. An empty array for both include and + ## exclude will include all labels. # label_include = [] # label_exclude = ["*"] diff --git a/plugins/inputs/kubernetes/kubernetes.go b/plugins/inputs/kubernetes/kubernetes.go index 2342d5f4d..412db1dc3 100644 --- a/plugins/inputs/kubernetes/kubernetes.go +++ b/plugins/inputs/kubernetes/kubernetes.go @@ -3,7 +3,6 @@ package kubernetes import ( "encoding/json" "fmt" - "github.com/influxdata/telegraf/filter" "io/ioutil" "net/http" "net/url" @@ -11,6 +10,7 @@ import ( "time" "github.com/influxdata/telegraf" + "github.com/influxdata/telegraf/filter" "github.com/influxdata/telegraf/internal" "github.com/influxdata/telegraf/internal/tls" "github.com/influxdata/telegraf/plugins/inputs" @@ -48,8 +48,8 @@ var sampleConfig = ` ## OR # bearer_token_string = "abc_123" - # Labels to include and exclude - # An empty array for include and exclude will include all labels + ## Pod labels to be added as tags. An empty array for both include and + ## exclude will include all labels. # label_include = [] # label_exclude = ["*"]