diff --git a/docs/sources/flow/reference/components/discovery.kubernetes.md b/docs/sources/flow/reference/components/discovery.kubernetes.md index 3dac34c7c711..94b8ee84d945 100644 --- a/docs/sources/flow/reference/components/discovery.kubernetes.md +++ b/docs/sources/flow/reference/components/discovery.kubernetes.md @@ -462,14 +462,20 @@ Replace the following: ### Limit to only pods on the same node -This example limits the search to pods on the same node as this {{< param "PRODUCT_ROOT_NAME" >}}. This configuration could be useful if you are running {{< param "PRODUCT_ROOT_NAME" >}} as a DaemonSet: +This example limits the search to pods on the same node as this {{< param "PRODUCT_ROOT_NAME" >}}. +This configuration could be useful if you are running {{< param "PRODUCT_ROOT_NAME" >}} as a DaemonSet. + +{{% admonition type="note" %}} +This example assumes you have used Helm chart to deploy {{< param "PRODUCT_NAME" >}} in Kubernetes and sets `HOSTNAME` to the Kubernetes host name. +If you have a custom Kubernetes deployment, you must adapt this example to your configuration. +{{% /admonition %}} ```river discovery.kubernetes "k8s_pods" { role = "pod" selectors { role = "pod" - field = "spec.nodeName=" + constants.hostname + field = "spec.nodeName=" + coalesce(env("HOSTNAME"), constants.hostname) } } @@ -489,6 +495,7 @@ prometheus.remote_write "demo" { } } ``` + Replace the following: - `PROMETHEUS_REMOTE_WRITE_URL`: The URL of the Prometheus remote_write-compatible server to send metrics to. - `USERNAME`: The username to use for authentication to the remote_write API.