docs(inputs.kubernetes): Add link to generating bearer token to explore API (#15335)

This commit is contained in:
Joshua Powers 2024-05-10 10:24:03 -06:00 committed by GitHub
parent 1676535e31
commit bdf14aad72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 7 deletions

View File

@ -6,21 +6,27 @@ 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.
Kubernetes is a fast moving project, with a new minor release every 3 months. As
such, this plugin aims to maintain support only for versions that are supported
by the major cloud providers, namely, 4 release over 2 years.
## Host IP
To find the ip address of the host you are running on you can issue a command
like the following:
```sh
curl -s $API_URL/api/v1/namespaces/$POD_NAMESPACE/pods/$HOSTNAME --header "Authorization: Bearer $TOKEN" --insecure | jq -r '.status.hostIP'
curl -s $API_URL/api/v1/namespaces/$POD_NAMESPACE/pods/$HOSTNAME \
--header "Authorization: Bearer $TOKEN" \
--insecure | jq -r '.status.hostIP'
```
In this case we used the downward API to pass in the `$POD_NAMESPACE` and
This example uses the downward API to pass in the `$POD_NAMESPACE` and
`$HOSTNAME` is the hostname of the pod which is set by the kubernetes API.
See the [Kubernetes docs][] for a full example of generating a bearer token to
explore the Kubernetes API.
Kubernetes is a fast moving project, with a new minor release every 3 months. As
such, we will aim to maintain support only for versions that are supported by
the major cloud providers; this is roughly 4 release / 2 years.
**This plugin supports Kubernetes 1.11 and later.**
[Kubernetes docs]: https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/#without-kubectl-proxy
## Series Cardinality Warning