-
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
[Elastic Agent] Add support for Fleet Server inside Docker #24220
[Elastic Agent] Add support for Fleet Server inside Docker #24220
Conversation
Pinging @elastic/fleet (Team:Fleet) |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
/package |
/test |
} | ||
c.log.Info("Successfully triggered restart on running Elastic Agent.") | ||
c.stopAgent() |
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.
not necessary; based on defer c.stopAgent()
in L169
This prepares the Fleet plugin that exists inside of Kibana. This must either be enabled here or done externally | ||
before Fleet Server will actually successfully start. | ||
|
||
KIBANA_FLEET_SETUP - set to 1 enables this setup |
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 is a (silent) breaking change, that will break setups working with FLEET_SETUP
, without any error message. The Elastic Agent starts, but does not perform the fleet set up. I am wondering if we should be backwards compatible here and also support FLEET_SETUP
(until 8.0
) although not GA yet.
Otherwise, could you create a docs follow up issue to ensure this is captured somwhere, otherwise people probably have a hard time figuring this out.
Pinging @elastic/ingest-management (Team:Ingest Management) |
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.
Changes LGTM
/test |
Fix enrollment due to elastic/beats#24220
Fix enrollment due to elastic/beats#24220
* adapt setup to changes from elastic/beats#24220
* adapt setup to changes from elastic/beats#24220
Fix enrollment due to elastic/beats#24220
Fix enrollment due to elastic/beats#24220 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What does this PR do?
First it refactors the entrypoint for the Elastic Agent docker container to use a new subcommand
container
. This subcommand is designed specifically to be executed by the container runtime. Based on the defined environment variables it prepares the Elastic Agent to run in that environment. Due to the large number of environment variables that Elastic Agent needed and the complexity of the order of operations based it was best to move this from a bash script to golang.With the refactor comes the ability to bootstrap the Elastic Agent inside of a docker container. Using the
FLEET_SERVER_ENABLE
flag the docker container will bootstrap the Fleet Server and enroll the Elastic Agent all inside the container on startup.Why is it important?
To allow Fleet Server to be spawned under Elastic Agent while being executed under Docker.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.