Skip to content

[Elastic Agent] Install command does not work with Fleet Server bootstrap #24950

@blakerouse

Description

@blakerouse

Running the install command will prompt for questions it should not ask when running with --fleet-server parameter.

sudo ./elastic-agent install --fleet-server https://elastic:${pass}@fleet-server-enroll.es.us-central1.gcp.foundit.no:9243 --enrollment-token ${token}
Password:
The Elastic Agent is currently in BETA and should not be used in production

Elastic Agent will be installed at /Library/Elastic/Agent and will run as a service. Do you want to continue? [Y/n]:Y
Do you want to enroll this Agent into Fleet? [Y/n]:Y
URL you want to enroll this Agent into: ^C

If you force the install with -f it still does not perform the bootstrap of the Fleet Server.

sudo ./elastic-agent install --fleet-server https://elastic:${pass}@fleet-server-enroll.es.us-central1.gcp.foundit.no:9243 --enrollment-token ${token} -f
The Elastic Agent is currently in BETA and should not be used in production

This will just cause the Elastic Agent to be installed in standalone mode and not actually enroll or start Fleet Server.

To workaround for this is to perform enroll after the install command. Then the Elastic Agent will run Fleet Server and enroll into Fleet.

% cd /Library/Elastic/Agen
% sudo ./elastic-agent enroll --fleet-server https://elastic:${pass}@fleet-server-enroll.es.us-central1.gcp.foundit.no:9243 --enrollment-token ${token} -f
The Elastic Agent is currently in BETA and should not be used in production

2021-04-06T11:27:55.615-0400	INFO	cmd/enroll_cmd.go:281	Generating self-signed certificate for Fleet Server
2021-04-06T11:27:57.056-0400	INFO	cmd/enroll_cmd.go:527	Waiting for Elastic Agent to start Fleet Server
2021-04-06T11:27:58.063-0400	INFO	cmd/enroll_cmd.go:558	Fleet Server - Starting
2021-04-06T11:28:01.078-0400	INFO	cmd/enroll_cmd.go:541	Fleet Server - Running on default policy with Fleet Server integration
2021-04-06T11:28:02.472-0400	INFO	cmd/enroll_cmd.go:190	Successfully triggered restart on running Elastic Agent.
Successfully enrolled the Elastic Agent.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions