Skip to content
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 hints based autodiscover part #2182

Merged
merged 3 commits into from
Sep 19, 2022
Merged

Conversation

ChrsMark
Copy link
Member

Adds documentation part for elastic/elastic-agent#662

@ChrsMark ChrsMark self-assigned this Sep 15, 2022
@mergify
Copy link
Contributor

mergify bot commented Sep 15, 2022

This pull request does not have a backport label. Could you fix it @ChrsMark? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-/d./d is the label to automatically backport to the /d./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Sep 15, 2022
@apmmachine
Copy link
Contributor

apmmachine commented Sep 15, 2022

A documentation preview will be available soon:

@ChrsMark ChrsMark added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team label Sep 19, 2022
@ChrsMark
Copy link
Member Author

@elastic/obs-cloudnative-monitoring could someone have a look into this one please?

@ChrsMark ChrsMark requested a review from gizas September 19, 2022 11:54
@@ -331,6 +331,81 @@ The policy generated by this configuration looks like:
target: orchestrator
----

[discrete]
== Autodiscover targeted Pods using hints (standalone mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe mention in the title that it is related to the Elastic Agent?

Suggested change
== Autodiscover targeted Pods using hints (standalone mode)
== Autodiscover targeted Pods using hints (Elastic Agent standalone mode)

== Autodiscover targeted Pods using hints (standalone mode)

Standalone Elastic Agent supports autodiscover based on hints from the provider.
The hints system looks for hints in Kubernetes Pod annotations which have the prefix `co.elastic.hints`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what hints system here means?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe hints mechanism instead of system.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

[float]
===== `co.elastic.hints/username`

The username to use for authentication
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

username and password are required?
is it elasticsearch credentioals?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are integrations variables. If it is Redis for example , it should be Redis creds

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, those are integration level settings. Keep in mind that most of them are taken directly from Beat's docs :) .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks more like a required credentials, not as an configuration of specific integration 😕
but, yes, I found the beats doc - https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-autodiscover-hints.html#_co_elastic_metricsusername


The stream to use for logs collection, ie stdout/stderr.

In any case if the specified package has no logs support the generic `container_logs` input will be used as a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be 'container_logs input' or 'container_logs datastream of kubernetes package'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

----
providers:
kubernetes:
node: "kind-control-plane"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be more generic and use node: ${NODE_NAME} ?

----
providers:
kubernetes:
node: "kind-control-plane"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be more generic : ${NODE_NAME} ?

Then ensure that the proper volumes and volumeMounts are added properly. These sections are already defined in the
provided kubernetes manifest, so it's only required to uncomment these sections.

In order to enable hints one need to add the `hints.enabled: true` in the provider's configuration, ie:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something went wrong here! Thanks!

hints.enabled: true
----

In order to enable hints one need to add the `hints.enabled: true` in the provider's configuration, ie:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- -c
- >-
mkdir -p /etc/elastic-agent/inputs.d &&
wget -O - https://github.com/elastic/elastic-agent/archive/8.5.0.tar.gz | tar xz -C /etc/elastic-agent/inputs.d --strip=5 "elastic-agent-main/deploy/kubernetes/elastic-agent-standalone/templates.d"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path is fixed for 8.5. Should this be updated in each stack release or should we have a placeholder here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. We properly handle it in the official manifests, see https://github.com/elastic/elastic-agent/blob/main/deploy/kubernetes/elastic-agent-standalone/elastic-agent-standalone-daemonset.yaml#L37. Here since it's just docs' example it should be fine but I will make it to use the proper version dynamically like what we do in the curl command in the very beginning of this guide.

Copy link
Contributor

@MichaelKatsoulis MichaelKatsoulis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a few cosmetic comments.

Signed-off-by: ChrsMark <[email protected]>
Copy link
Contributor

@tetianakravchenko tetianakravchenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ChrsMark ChrsMark merged commit fdddf1f into elastic:main Sep 19, 2022
bmorelli25 pushed a commit to bmorelli25/observability-docs that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.5-candidate backport-skip Skip notification from the automated backport with mergify Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants