-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add missing kubernetes fields; update istio doc to use kubernetes.pod.ip instead of host #37578
Merged
tetianakravchenko
merged 6 commits into
elastic:main
from
tetianakravchenko:autodiscover-documentation
Jan 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a93c80d
add missing kubernetes fields; update istio doc to use kubernetes.pod…
tetianakravchenko 00cb450
extend documentation with full list of fields; fix add_resource_metad…
tetianakravchenko 2fbf545
test all variables and adjust documentation accordingly
tetianakravchenko 576106a
Merge branch 'main' into autodiscover-documentation
tetianakravchenko 6041d3f
Update libbeat/docs/shared-autodiscover.asciidoc
tetianakravchenko e9371aa
Update libbeat/docs/shared-autodiscover.asciidoc
tetianakravchenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The field name is indeed kubernetes.namespace_uid.
@tetianakravchenko maybe we should find a way in this document to add also
kubernetes.labels
,kubernetes.annotations
,kubernetes.namespace_labels
andkubernetes.namespace_annotations
. Those metadata fields are also part of the metadata fields that can be used in templating when the right parameters are set.There is this section in the doc that states
which is ok as an information but we don't list the field. Maybe we could list all fields above and leave those comments there as is.
Also we could add some comments about the namespace_labels and namespace_annotations based on the add_resource_metadata configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gsantoro there is no such field as
kubernetes.namespace.uid
:I see that we have such field documented for elastic-agent - https://www.elastic.co/guide/en/fleet/current/kubernetes-provider.html, I believe it is a mistake in the elastic-agent documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelKatsoulis I am trying to wrap my head around the docs and the implementation.
I can found two references kubernetes dynamic variables at https://www.elastic.co/guide/en/fleet/current/kubernetes-provider.html and https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-autodiscover.html. For example kubernetes.namespace.uid is in the first one and not in the second doc.
Should those two docs have the same variables and both of them have kubernetes.namespace_uid?
what about this code from elastic-agent-autodiscover where the docs point at namespace.uid and the test at namespace_uid? at https://github.com/elastic/elastic-agent-autodiscover/blob/4f4898db82e5a5b37eab7e0e093435b9fb739461/kubernetes/metadata/namespace_test.go#L69
I could use some clarification about where in the code those variables are created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gsantoro kubernetes.namespace is unfortunately a keyword and not an object. There was a try in 8.0 to do this breaking change and put all namespace related fields under the kubernetes.namespace object but it was reverted before it reached production. This was done mainly because of the possible problems it would create to existing customers and the not easy migration procedure.
The documentation in https://www.elastic.co/guide/en/fleet/current/kubernetes-provider.html is wrong. The part of the code where those values are added is here https://github.com/elastic/elastic-agent-autodiscover/blob/b42be0df903aba6580b80761af6df86fa80c845d/kubernetes/metadata/namespace.go#L117