-
Notifications
You must be signed in to change notification settings - Fork 144
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
Send fleet-server elasticsearch config under new bootstrap attribute #4643
Send fleet-server elasticsearch config under new bootstrap attribute #4643
Conversation
This pull request does not have a backport label. Could you fix it @michel-laterman? 🙏
NOTE: |
Approach LGTM. Do we have an automated test to ensure the agent can bootstrap a real fleet server already? If not we are going to need one. |
We don't have a full e2e test where we run a compiled agent with a fleet-server. This can be added in a followup PR as this change requires fleet-server's pr to also be merged. We have partial integration tests in fleet-server where we fake agent communications to validate that the bootstrap sequence works as expected (i.e., state is degraded if no agent id is provided and goes healthy after): https://github.com/elastic/fleet-server/blob/main/internal/pkg/server/agent_integration_test.go And fleet-server also has some disabled e2e tests (that never ran properly through ci) to test agent bootstrapping. @blakerouse tells me that we should be able to add a fleet-server bootstrap test as part of the integration test suite in elastic-agent as long as we don't use containers. |
We probably need a test that fleet server can be bootstrapped in both repositories, so we can prevent merging changes that would break it before they hit the snapshot image. |
Currently; when I try to use a binarry built with this PR in ESS I get
|
The spec file declaring the fleet-server input type is missing. |
OK, using a VM I was finally able to build and push an image for testing. I have confirmed that:
There are still some other automated tests we need to verify before merging these 2 PRs |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
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.
Simple change, like it!
Fix the changelog before merging.
changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml
Outdated
Show resolved
Hide resolved
changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml
Outdated
Show resolved
Hide resolved
changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml
Outdated
Show resolved
Hide resolved
changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml
Outdated
Show resolved
Hide resolved
changelog/fragments/1714505172-Send-fleet-server-component-output-under-bootstrap-key.yaml
Outdated
Show resolved
Hide resolved
Does this need to be merged together with elastic/fleet-server#3506? I think there needs to be an automated test that Elastic Agent can bootstrap Fleet Server in one of the repositories before we merge either of these. Edit: 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. |
I've merged the changes to fleet-server. |
Here are the issues to add bootstrap tests: |
I would like to see #4769 done as part of this PR. You are going to have to do this test manually without it, may as well make the test framework do the work for you. |
9bc9c89
to
5d16be7
Compare
5d16be7
to
0aa1bc4
Compare
9110717
to
20f4a25
Compare
Quality Gate passedIssues Measures |
What does this PR do?
Alter the fleet-server bootstrap component modifier to insert all (elasticsearch)
output configuration options specified by enrollment args under a new elasticsearch.boostrap key
instead of overwriting any existing keys. This will allow elastic-agent to send the list of hosts
(and other config options) retrieved from a policy to fleet server as well as the config needed
to form the initial connection to elasticsearch used to collect policy information.
Fleet-server will be altered to use the bootstrap config that is passed if the policy attributes
are unspecified or fail.
Why is it important?
Fleet-server instances running under an elastic-agent are not able to connect to multiple ES hosts, or use any output settings that update local configuration that has been specified during enrolment.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files./changelog/fragments
using the changelog toolHow to test this PR locally
See description for: elastic/fleet-server#3506
Related issues