[Elastic Agent] Fix install with bootstrapping Fleet Server#24981
[Elastic Agent] Fix install with bootstrapping Fleet Server#24981blakerouse merged 9 commits intoelastic:masterfrom
Conversation
… for the enrollment token when bootstrapping with Fleet Server.
|
Pinging @elastic/agent (Team:Agent) |
|
@ruflin @EricDavisX This removes the requirement of needing the I am not marking this as breaking, because you can still provide one if you want. Its just no longer required to provide one. |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
| kbn, ok := transpiler.Lookup(ast, "fleet.kibana") | ||
| if !ok { | ||
| return fmt.Errorf("failed to get kibana config key from fleet config") | ||
| if ok { |
There was a problem hiding this comment.
we can do inline now to reduce scope
|
|
||
| if enroll { | ||
| if url == "" { | ||
| if url == "" && fleetServer == "" { |
There was a problem hiding this comment.
could we just move this to enroll && fleetServer == "" and remove also from the if above
or if the goal here is to skip enroll for fleet server maybe we can just extract this up to the line 140 into a Fn and execute only when fleetServer == ""
these ifs are getting complicated
There was a problem hiding this comment.
I was able to simplify this by moving it up. The goal here is to ask for URL and Token in the case that it is not provided. The complexity comes from install being interactive.
|
@michalpristas Ready for another look |
michalpristas
left a comment
There was a problem hiding this comment.
seems ok, tested with latest kibana
|
/test |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
* Fix install command to work with Fleet Server, remove the requirement for the enrollment token when bootstrapping with Fleet Server. * Fix tests. * Add changelog entry. * Simplify if statements. * Add installation success confirmation message. * Fix leaderelection provider. * Fix fleet decorator. (cherry picked from commit a91bba5)
…24998) * Fix install command to work with Fleet Server, remove the requirement for the enrollment token when bootstrapping with Fleet Server. * Fix tests. * Add changelog entry. * Simplify if statements. * Add installation success confirmation message. * Fix leaderelection provider. * Fix fleet decorator. (cherry picked from commit a91bba5) Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
What does this PR do?
This fixes the
installcommand to allow Fleet Server to be bootstrapped properly. This also adds better logging to theenrollcommand (that is called byinstall) so its clear what might be causing the bootstrap of Fleet Server to fail.This branch also uses a new feature from Fleet Server that removes the requirement of needing to pass the
--enrollment-tokento eitherinstallorenroll. Now Fleet Server will tell the Elastic Agent which enrollment token to use and Elastic Agent will use it to perform enrollment. This makes the installation of Elastic Agent with Fleet Server to just the following:This includes removing the requirement for the Docker container to even have to talk to Kibana when bootstrapping with Fleet Server. The following command would run the container and it would not even talk to Kibana at any point.
This includes some fixes to the paths that was prevent Fleet Server from starting.
Why is it important?
So bootstrapping of Fleet Server works with the
installcommand and to simplify the bootstrapping process by removing the requirement for--enrollment-token.Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration filesCHANGELOG.next.asciidocorCHANGELOG-developer.next.asciidoc.Related issues
Logs