Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Auto bootstrap fleet during initialize scenario (#1116)
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Stokes <51892+adam-stokes@users.noreply.github.com>

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
  • Loading branch information
adam-stokes and mdelapenya authored May 3, 2021
1 parent 16890c1 commit 66d5ec3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ xpack.fleet.registryUrl: http://package-registry:8080
xpack.fleet.agents.enabled: true
xpack.fleet.agents.elasticsearch.host: http://elasticsearch:9200
xpack.fleet.agents.fleet_server.hosts:
- http://kibana:5601
- http://fleet-server:8220
xpack.fleet.agents.tlsCheckDisabled: true
19 changes: 19 additions & 0 deletions cli/config/compose/profiles/fleet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,22 @@ services:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
retries: 300
interval: 1s

fleet-server:
image: "docker.elastic.co/beats/elastic-agent:${stackVersion:-8.0.0-SNAPSHOT}"
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
healthcheck:
test: "curl -f http://127.0.0.1:8220/api/status | grep HEALTHY 2>&1 >/dev/null"
retries: 12
interval: 5s
environment:
- "FLEET_SERVER_ENABLE=1"
- "FLEET_SERVER_INSECURE_HTTP=1"
- "KIBANA_FLEET_SETUP=1"
- "KIBANA_FLEET_HOST=http://kibana:5601"
- "FLEET_SERVER_HOST=0.0.0.0"
- "FLEET_SERVER_PORT=8220"
16 changes: 0 additions & 16 deletions e2e/_suites/fleet/ingest_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,6 @@ func InitializeIngestManagerTestSuite(ctx *godog.TestSuiteContext) {

imts.Fleet.setup()

// we are going to bootstrap Fleet Server in a centos container, using TAR installer, and the base version
// Because it is the first agent in Fleet, there is no FleetServerHost
fleetServerBaseImage := "centos"
fleetServerInstallerType := "tar"
fleetServerVersion := common.AgentVersionBase
agentInstaller := installer.GetElasticAgentInstaller(fleetServerBaseImage, fleetServerInstallerType, fleetServerVersion, "")

// bootstrap Fleet Server only once: we need to set the version here
imts.Fleet.Version = fleetServerVersion
err = imts.Fleet.bootstrapFleetServerWithInstaller(fleetServerBaseImage, fleetServerInstallerType)
if err != nil {
log.WithFields(log.Fields{
"installer": agentInstaller,
}).Fatal("Fleet Server could not be bootstrapped")
}

imts.StandAlone.RuntimeDependenciesStartDate = time.Now().UTC()
})

Expand Down

0 comments on commit 66d5ec3

Please sign in to comment.