From e510afa4d179c504b6a41b89f8eb97d08549c6a0 Mon Sep 17 00:00:00 2001 From: Devin H <1331204+dhalperin@users.noreply.github.com> Date: Wed, 26 Jul 2023 01:04:02 +0800 Subject: [PATCH] Update discovery.kubernetes.md (#4522) * Update discovery.kubernetes.md Added selectors section to the Limited Searched Namespaces section and changed the description of the section to add the specific labels aspect. * Update docs/sources/flow/reference/components/discovery.kubernetes.md Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> * Update docs/sources/flow/reference/components/discovery.kubernetes.md Co-authored-by: Mischa Thompson * Update docs/sources/flow/reference/components/discovery.kubernetes.md Co-authored-by: Mischa Thompson * Minor fix to remove full stop --------- Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> Co-authored-by: Mischa Thompson (cherry picked from commit 3e2c52f774eaed8140a73309d255295dd8f3503a) --- .../flow/reference/components/discovery.kubernetes.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/sources/flow/reference/components/discovery.kubernetes.md b/docs/sources/flow/reference/components/discovery.kubernetes.md index b4fbc9b6ca24..46a471a35178 100644 --- a/docs/sources/flow/reference/components/discovery.kubernetes.md +++ b/docs/sources/flow/reference/components/discovery.kubernetes.md @@ -415,13 +415,19 @@ Replace the following: - `USERNAME`: The username to use for authentication to the remote_write API. - `PASSWORD`: The password to use for authentication to the remote_write API. -### Limit searched namespaces +### Limit searched namespaces and filter by labels value -This example limits the namespaces where pods are discovered using the `namespaces` block: +This example limits the searched namespaces and only selects pods with a specific label value attached to them: ```river discovery.kubernetes "k8s_pods" { role = "pod" + + selectors { + role = "pod" + label = "app.kubernetes.io/name=prometheus-node-exporter" + } + namespaces { names = ["myapp"] }