Elastic Agent by Docker Image

I want to deploy Stand-alone Elastic Agent using Docker image. I followed the instruction in this page but, I am not sure which environment variables I should use to deploy the Agent as Stand-alone. Elastic Search and Kibana 8.8.1 both running on Docker on the same host, an Ubuntu 22.4 LTS.

However, I tried starting the Agent's container with Fleet Server and thought below script will also add the Fleet Server. But it seems that is not the case, correct?

docker run --name elastic_agent --net elastic_net 
--env FLEET_SERVER_ENABLE=true 
--env FLEET_SERVER_ELASTICSEARCH_HOST=https://172.19.0.2:9200 
--env FLEET_SERVER_SERVICE_TOKEN=some_hash 
--env FLEET_SERVER_POLICY_ID='postgres_agent_1' 
-p 8220:8220 
-it docker.elastic.co/beats/elastic-agent:8.8.1

So, after running, this is part of the error log:

{"log.level":"error","@timestamp":"2023-07-17T16:25:01.989Z","log.origin":{"file.name":"coordinator/coordinator.go","file.line":978},"message":"Unit state changed fleet-server-default (STARTING->FAILED): Error - tls: failed to verify certificate: x509: certificate signed by unknown authority","log":{"source":"elastic-agent"},"component":{"id":"fleet-server-default","state":"HEALTHY"},"unit":{"id":"fleet-server-default","type":"output","state":"FAILED","old_state":"STARTING"},"ecs.version":"1.6.0"}

But I can not add the certificate because there is no Fleet Server.

So does this mean, that I need to first add Fleet Server using normal TAR / RPM, and then I can add Agents to it (from other hosts) - either by Container or package?

And in case, I want to run the Agent's container as Stand-alone, what env I should use on Docker run command?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.