Skip to content

[rds] Expose re_eval_sec consistently across all rds clients ; Expose k8s namespace metadata - #1274

Closed
conallob wants to merge 8 commits into
cloudprober:mainfrom
conallob:k8s_discovery_expose_namespace_metadata
Closed

conallob wants to merge 8 commits into
cloudprober:mainfrom
conallob:k8s_discovery_expose_namespace_metadata

Conversation

@conallob

Copy link
Copy Markdown
Contributor
  • Plumb through the ability to set re_eval_sec on any rds mechanism consistently, not just for a subset of them

  • Include the namespace metadata in k8s service discovery results

Arsh Bhatti and others added 8 commits March 16, 2026 11:37
Implements Consul as a resource discovery provider for Cloudprober, allowing
probe targets to be discovered dynamically from a Consul service catalog.

Uses the Consul HTTP REST API directly (net/http + encoding/json) without
taking a dependency on github.com/hashicorp/consul/api, following the same
pattern as the Kubernetes RDS provider.

Features:
- Discover services, health checks, and nodes from Consul
- Filter by service name (regex), tags, health status, and metadata
- Propagate Consul service/node metadata as labels for use with
  @target.label.KEY@ in probe additional_label configs
- Respect standard Consul environment variables: CONSUL_HTTP_ADDR,
  CONSUL_HTTP_TOKEN, CONSUL_HTTP_TOKEN_FILE, CONSUL_DATACENTER,
  CONSUL_HTTP_SSL
- Kubernetes auto-discovery: CONSUL_HTTP_ADDR=auto-discover resolves
  Consul via Kubernetes DNS (customizable via CONSUL_K8S_* vars)
- Periodic refresh (re_eval_sec, default 60s)
- Register with the RDS server as the "consul" provider

Contributes to cloudprober#1063

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The consul surfacer was replaced by the CLI-flag-driven registration module
(internal/registration/consul). Remove the examples/surfacers/consul/ directory
which referenced the deleted surfacer, and drop the broken link to it from
the targets/consul README.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@manugarg

Copy link
Copy Markdown
Contributor

I think this PR anyway pulled in many unrelated changes and some suggestions of it have been implemented through other PRs in a slightly different way:

  • Target update interval -- implemented in a way that it doesn't confuse it with re_eval_sec which is a different mechanism.
  • Namespace export -- implemented as a label. Prefixing it to the resource name like in this PR would've broken existing users.

@manugarg manugarg closed this Sep 12, 2026
manugarg added a commit that referenced this pull request Sep 13, 2026
* [rds/kubernetes] Add a namespace label to discovered resources

Resources for all four kinds (pods, services, endpoints, ingresses) now
carry a "namespace" label, so probes can use it through
@target.label.namespace@ and filter on it with labels.namespace. An
object label named "namespace" takes precedence.

Picks up the namespace label part of #1274.

* [rds.kubernetes] Don't overwrite object labels named node or pod in endpoints

Match namespace, fqdn and relative_url: if the endpoints object already
has a node or pod label, keep its value.
@conallob

Copy link
Copy Markdown
Contributor Author

Agreed, #1255 was a related PR that made this PR redundant

@conallob
conallob deleted the k8s_discovery_expose_namespace_metadata branch September 13, 2026 22:24
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.

2 participants