-
Notifications
You must be signed in to change notification settings - Fork 78
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
Agent mode support for bootstrap output #3506
Agent mode support for bootstrap output #3506
Conversation
79978ac
to
fcec504
Compare
Add support for a bootstrap attribute in the output when running in agent mode. If this attribute is missing the output block is used directly. If the attribute is provided, then any attributes within bootstrap that are not in the parent (output) object are recursivly injected and the resulting output is tested. If the resulting config works it is used, if it fails the test the bootstrap config is passed.
fcec504
to
07bb754
Compare
b01efb6
to
92260e3
Compare
Testing progress: elastic/elastic-agent#4643 (comment) i'll now try to implement the areas of improvement above:
|
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.
Just a couple of comments, looks good overall
I think we need an automated test proving that Elastic Agent can bootstrap Fleet Server in one of the repositories before this or elastic/elastic-agent#4643 are merged. If the coordination of the two PRs with the test is annoying enough I'd be fine with the test being added a separate PR, but not closing the implementation issue until it exists. |
buildkite test this |
Quality Gate passedIssues Measures |
What is the problem this PR solves?
When running under the elastic-agent fleet-server is not able to use output settings from it's policy.
How does this PR solve the problem?
This PR requires elastic/elastic-agent#4643 to work.
The elastic-agent will inject enrollment configuration options in
output.elasticsearch.bootstrap
instead of overwriting matching keys inoutput.elasticsearch
.When running under agent mode, fleet-server will inject specific keys in
bootstrap
that are not inoutput.elasticsearch
, then test the resulting output to see if it can connect to Elasticsearch, if so it is used. If not thenbootstrap
is used instead and the output is periodically retested in case the failure was caused by a temporary network issue.How to test this PR locally
Create an elastic-agent package from: elastic/elastic-agent#4643
replace the fleet-server component using one generated from this pr.
If testing with docker images
docker.elastic.co/observability-ci/elastic-agent:8.15.0-SNAPSHOT-dd4c89e-1715633206
can be used as theBASE_IMAGE
for generating a new image/deployment with themake cloud-deploy
target indev-tools/cloud
.Or the
docker.elastic.co/observability-ci/elastic-agent:8.15.0-SNAPSHOT-laterman-1715705581
image can be used as it contains the changes from both PRs.I've verified that the following behaviours work:
When deployed to ESS:
When deployed locally:
Design Checklist
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragments
using the changelog toolRelated issues