Skip to content

discovery/kubernetes: add pod service discovery (role: pod) - #45

Draft
bwplotka wants to merge 2 commits into
bwplotka/http-configfrom
bwplotka/discovery-k8s-pod
Draft

bwplotka wants to merge 2 commits into
bwplotka/http-configfrom
bwplotka/discovery-k8s-pod

Conversation

@bwplotka

@bwplotka bwplotka commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Adds the discovery-kubernetes Cargo feature (["discovery", "http-config"]) with KubernetesSdConfig validation, build_pod_target_group matching Prometheus pod.go, and KubernetesPodDiscovery querying the Kubernetes REST API directly via reqwest without kube-rs or k8s-openapi. Part of prometheus/scrape.rs#36.

Stack:

  1. discovery: add TargetGroup, StaticConfig, and Prometheus duration helpers #39 discovery: add TargetGroup, StaticConfig, and Prometheus duration helpers
  2. discovery/dns: add DNS service discovery (dns_sd_configs) #43 discovery/dns: add DNS service discovery (dns_sd_configs)
  3. http_config: add Prometheus HTTPClientConfig and reqwest client builder #44 http_config: add Prometheus HTTPClientConfig and reqwest client builder
  4. discovery/kubernetes: add pod service discovery (role: pod) #45 discovery/kubernetes: add pod service discovery (role: pod) (this PR)

Commits in reading order:

  1. 4ca6797: discovery/kubernetes: add KubernetesSdConfig and pod target group builder
  2. b87ab0e: discovery/kubernetes: add reqwest-based KubernetesPodDiscovery runner
Intentional differences from Go

…lder

Add feature = "discovery-kubernetes", KubernetesSdConfig validation and path resolution, #[non_exhaustive] Kubernetes resource models, and build_pod_target_group matching Prometheus pod.go.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
Query the Kubernetes API server over reqwest for pods and optional attach_metadata resources (nodes, namespaces with 404 tolerance, ReplicaSets, Jobs), supporting explicit api_server, in-cluster env/token/CA resolution, and !Send LocalSet execution.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant