-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Kubernetes Provider] Allow wildcards or regex when specifying "include_labels" and "include_annotations" #3346
Comments
Added initial effort elastic/elastic-agent-autodiscover@main...regexannotations We will need to try testing this first effort |
The PR for elastic-agent-autodiscovery library introduces the functionality.
|
What kind of libraries? 🤔 |
:) Meant to write labels !!! Rephrased it |
…todiscovery library (#60) This PR introduces the main functionality in order to support the regex expression for kubernetes provider as described here: elastic/elastic-agent#3346
I have run the manual tests end-to-end and I can verify that by adding in state_pod add_resource_metadata:
namespace:
use_regex_inlcude: true
include_labels: ["kubernetes"] And As you can see below we match only kubernetes* labels But we hit the bug: #3636 So we need to fix this bug before retesting this feature further |
The above #3636 has been fixed in elastic/beats#37458, all agent versions with elastic-agent-autodiscovery library >= v0.6.6 I have resumed the tests for the regex support. The functionality is there Draft Documentation RP: elastic/ingest-docs#814
add_resource_metadata:
namespace:
use_regex_include: true
include_labels:
- pas
node:
use_regex_include: true
include_labels:
- kubernetes
Everything tested correctly in version>= 8.12.0 |
Describe the enhancement:
Currently the Kubernetes Provider includes the following config options:
include_annotations
,include_labels
(and alsoexclude_labels
) and allows users to optionally add to the provider config the list of annotations and labels present accordingly.Those config options does not support wild cards or regex expressions to dynamically configure the wanted list of annotations or labels. This enhancement request focuses to this functionality.
Describe a specific use case for the enhancement or feature:
Lets assume the following pod specification:
The user would require to configure "include_labels": ["demo-1", "demo-2"] to match all labels
So the enhancement will allow "include_labels": "demo-*" to match all demo-1 and demo-2 labels of the example pod.
What is the definition of done?
include_annotations
,include_labels
and alsoexclude_labels
Relevant Links:
The text was updated successfully, but these errors were encountered: