-
Notifications
You must be signed in to change notification settings - Fork 169
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
Update kubernetes provider documentation and 8.6 release notes #2552
Update kubernetes provider documentation and 8.6 release notes #2552
Conversation
…usage of kubernetes labels in autodiscover conditions
A documentation preview will be available soon: |
This pull request does not have a backport label. Could you fix it @MichaelKatsoulis? 🙏
|
@@ -84,6 +86,13 @@ To set the target host dynamically for a targeted Pod based on its labels, use a | |||
condition: ${kubernetes.labels.component} == 'kube-scheduler' | |||
---- | |||
|
|||
NOTE: Pods labels and annotations can be used in autodiscover conditions. In the case of labels or annotations that include dots(`.`), they can be used in conditions exactly as | |||
they are defined in the pods. For example `condition: ${kubernetes.labels.app.kubernetes.io/name} == 'ingress-nginx'`. This should not be mistaken with optional dedoted labels and annotations |
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.
Do you think can we enhance the examples here?
We like users to understand what is the actual label and what is the condition.
Also an example with annotation?
I think we should so a condition example before and after 8.6.0
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.
To me, there is already an example with the usage of labels in conditions. It is mentioned above that The condition ${kubernetes.labels.app} == 'redis' will make the Elastic Agent look for a Pod with the label app:redis within the scope defined in its manifest.
The more complex labels that are not dedoted any more is not a new case. It is just another label to be used. I believe that this note explains it.
@ChrsMark what do you think ?
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.
From my perspective this paragraph achieves the goal to explain how labels should be used in conditions specially regarding the dedoting concpet. Maybe we can add one extra example here for an annotation or provide a bunch of examples in a list like:
1. To target a Pod labeled with `app: apache` use the condition X
2. To target a Pod with the annotation .... use ....
It's up to you to decide how detailed you want to make it.
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.
I can add some examples of conditions with complex labels, annotations and host.ip without having to create detailed examples that do not offer a lot.
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.
LGTM now
@@ -84,6 +86,13 @@ To set the target host dynamically for a targeted Pod based on its labels, use a | |||
condition: ${kubernetes.labels.component} == 'kube-scheduler' | |||
---- | |||
|
|||
NOTE: Pods labels and annotations can be used in autodiscover conditions. In the case of labels or annotations that include dots(`.`), they can be used in conditions exactly as | |||
they are defined in the pods. For example `condition: ${kubernetes.labels.app.kubernetes.io/name} == 'ingress-nginx'`. This should not be mistaken with optional dedoted labels and annotations |
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.
This should not be mistaken with optional dedoted labels and annotations
stored into Elasticsearch([kubernetes-provider]).
This confused me more here. Do you think shall we remove it?
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.
Which line confused you?
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.
See above updated.
I mean do users need this link there.
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.
you mean this link Elasticsearch(<<kubernetes-provider>>)
. I have added that as it is the page that includes all the info regarding label and annotations dedoting
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.
Overall looks good. I've left some suggestions, feel free to include as many of them you find useful.
...gement/elastic-agent/configuration/autodiscovery/kubernetes-conditions-autodiscover.asciidoc
Outdated
Show resolved
Hide resolved
...gement/elastic-agent/configuration/autodiscovery/kubernetes-conditions-autodiscover.asciidoc
Outdated
Show resolved
Hide resolved
...gement/elastic-agent/configuration/autodiscovery/kubernetes-conditions-autodiscover.asciidoc
Outdated
Show resolved
Hide resolved
...gement/elastic-agent/configuration/autodiscovery/kubernetes-conditions-autodiscover.asciidoc
Outdated
Show resolved
Hide resolved
docs/en/ingest-management/elastic-agent/configuration/providers/kubernetes-provider.asciidoc
Outdated
Show resolved
Hide resolved
docs/en/ingest-management/elastic-agent/configuration/providers/kubernetes-provider.asciidoc
Outdated
Show resolved
Hide resolved
…overy/kubernetes-conditions-autodiscover.asciidoc Co-authored-by: Chris Mark <[email protected]>
…overy/kubernetes-conditions-autodiscover.asciidoc Co-authored-by: Chris Mark <[email protected]>
…overy/kubernetes-conditions-autodiscover.asciidoc Co-authored-by: Chris Mark <[email protected]>
…overy/kubernetes-conditions-autodiscover.asciidoc Co-authored-by: Chris Mark <[email protected]>
…s/kubernetes-provider.asciidoc Co-authored-by: Chris Mark <[email protected]>
…s/kubernetes-provider.asciidoc Co-authored-by: Chris Mark <[email protected]>
@@ -189,6 +189,9 @@ The available keys are: | |||
|
|||
|
|||
These are the fields available within config templating. The `kubernetes.*` fields will be available on each emitted event. | |||
`kubernetes.labels.*` and `kubernetes.annotations.*` used in config templating are not dedoted and should not be confused with |
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.
this sentence is in the same paragraph with the previous one - https://observability-docs_2552.docs-preview.app.elstc.co/guide/en/fleet/master/kubernetes-provider.html
can we split it? and maybe highlight with NOTE:
similar to https://github.com/elastic/observability-docs/pull/2552/files#diff-62a97949a501942a1b602f35ca893cebef309cffa0e97dd233dc6c7492a5d8f3R93?
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.
Yes you are right. I will highlight with NOTE
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.
@@ -67,7 +71,9 @@ You should now be able to see Redis data flowing in on index `metrics-redis.info | |||
|
|||
NOTE: All assets (dashboards, ingest pipelines, and so on) related to the Redis integration are not installed. You need to explicitly <<install-uninstall-integration-assets,install them through {kib}>>. | |||
|
|||
To set the target host dynamically for a targeted Pod based on its labels, use a variable in the {agent} policy to return path information from the provider: | |||
Conditions can also be used in the `Kubernetes` package in order to set the target host dynamically for a targeted Pod based on its labels. |
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.
by Kubernetes package
are you referring to the https://docs.elastic.co/en/integrations/kubernetes ?
for standalone we usually use in documentation input
instead of package, for example - here or here
can we keep it consistent?
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 input can have whatever name the user wants so kubernetes input
would not be accurate wording. Also in each input we have the package information inside the meta. And although not used anywhere, the name of the package is the same used in integrations.
Also I initially had written input
. But I changed it after @ChrsMark comment (#2552 (comment)).
Chris are your thoughts the same as mine in this?
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.
thank you for clarifications, I don't have a strong opinion on it
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.
No strong opinion either :)
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.
Ok as long you don't have a strong opinion I decided to use input
instead of package to keep consistency because I am not sure if the user at this point is 100% familiar with packages.
@@ -37,6 +37,10 @@ To automatically identify a Redis Pod and monitor it with the Redis integration, | |||
The condition `${kubernetes.labels.app} == 'redis'` will make the {agent} look for a Pod with the label `app:redis` within the scope defined in its manifest. | |||
|
|||
For a list of provider fields that you can use in conditions, refer to <<kubernetes-provider>>. | |||
Some examples of conditions usage are: | |||
1. For a pod with label `app.kubernetes.io/name=ingress-nginx` the condition should be `condition: ${kubernetes.labels.app.kubernetes.io/name} == "ingress-nginx"` |
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.
Also the numeric list here seems broken in the view https://github.com/elastic/observability-docs/blob/e7771ca322ef8a0a7b1c8cf1cc2493aa62c951d4/docs/en/ingest-management/elastic-agent/configuration/autodiscovery/kubernetes-conditions-autodiscover.asciidoc
Can you have a look to update it
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.
Fixed
…ic#2552) * Update kubernetes provder documentation to clearly state the correct usage of kubernetes labels in autodiscover conditions
Update kubernetes provider documentation to clearly state the correct usage of kubernetes labels in autodiscover conditions and 8.6 release notes with a breaking change.
This is due to changes done in elastic/elastic-agent#1398 effective in 8.6 release onwards.
Release notes have been updated, because even if this is considered a bug fix, there may be clients that have already set some templates in standalone agent or conditions in packages (the few that support it).
If in those conditions they make use of dedoted labels then when upgrading to agent 8.6, the data sets affected won't collect logs/metrics as the conditions won't match.
They need to manually update their configuration.
Updates of this PR can be found in #2552 (comment)
Fleet and Elastic Agent Guide
in three pages.