-
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
Add missing kubernetes fields; update istio doc to use kubernetes.pod.ip instead of host #37578
Conversation
….ip instead of host Signed-off-by: Tetiana Kravchenko <[email protected]>
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
@@ -221,18 +221,22 @@ These are the fields available within config templating. The `kubernetes.*` fiel | |||
* kubernetes.container.image | |||
* kubernetes.container.name | |||
* kubernetes.namespace | |||
* kubernetes.namespace_uid |
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.
* kubernetes.namespace_uid | |
* kubernetes.namespace.uid |
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
and kubernetes.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
If the `include_annotations` config is added to the provider config, then the list of annotations present in the config
are added to the event.
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
…ata.deployment and add_resource_metadata.cronjob as the default value is false Signed-off-by: Tetiana Kravchenko <[email protected]>
Hey @MichaelKatsoulis I've extended the list of fields - 00cb450, similar to what we have in https://www.elastic.co/guide/en/fleet/current/kubernetes-provider.html, but with correct namespace fields
does the commit above address this your comment? |
|
||
|`kubernetes.annotations.*` | ||
|`object` | ||
|Object of labels of the Node. Annotations are not available by default |
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 seems to be a typo here:
|Object of labels of the Node. Annotations are not available by default | |
|Object of annotations of the Node. Annotations are not available by default |
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.
Signed-off-by: Tetiana Kravchenko <[email protected]>
Co-authored-by: Andrew Gizas <[email protected]>
Co-authored-by: Andrew Gizas <[email protected]>
….ip instead of host (elastic#37578) * add missing kubernetes fields; update istio doc to use kubernetes.pod.ip instead of host Signed-off-by: Tetiana Kravchenko <[email protected]> * extend documentation with full list of fields; fix add_resource_metadata.deployment and add_resource_metadata.cronjob as the default value is false Signed-off-by: Tetiana Kravchenko <[email protected]> * test all variables and adjust documentation accordingly Signed-off-by: Tetiana Kravchenko <[email protected]> * Update libbeat/docs/shared-autodiscover.asciidoc Co-authored-by: Andrew Gizas <[email protected]> * Update libbeat/docs/shared-autodiscover.asciidoc Co-authored-by: Andrew Gizas <[email protected]> --------- Signed-off-by: Tetiana Kravchenko <[email protected]> Co-authored-by: Andrew Gizas <[email protected]>
Proposed commit message
kubernetes.pod.ip
instead ofhost
host
variable is confusing as it is not clear to which IP it is referringChecklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs