Repository navigation
[rds.kubernetes] Add a namespace label to discovered resources - #1489
Merged
Merged
Conversation
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.
…ndpoints Match namespace, fqdn and relative_url: if the endpoints object already has a node or pod label, keep its value.
manugarg
added a commit
that referenced
this pull request
Sep 13, 2026
Use kMetadata.resourceLabels(), as the other kinds do since #1489.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resources for all four Kubernetes kinds (pods, services, endpoints, ingresses) now carry a
namespacelabel, so probes can use it via@target.label.namespace@(e.g. inadditional_label) and filter on it withlabels.namespace.kMetadata.resourceLabels()helper returns a copy of the object's labels plusnamespace, so cached objects aren't modified.namespace, it takes precedence (same convention as ingressfqdn/relative_url).labels.namespaceworks for every kind.nodeorpod, so all labels Cloudprober adds (namespace,node,pod,fqdn,relative_url) follow the same rule. Behavior change: endpoints targets whose object has its ownnodeorpodlabel (e.g. copied from the Service) now report that value.This picks up the namespace label part of #1274. It doesn't prefix service names with the namespace, since that would rename existing targets.