Files
docker-elk/extensions/fleet/agent-apmserver-compose.yml
Antoine Cotten 24306fd49d feat!: Remove support for Compose v1
There has been no release of the deprecated 'docker-compose' Python
package since v1.29.2, which was published in May 2021[1]. This release
is currently broken due to a breaking change in the 'docker' Python
package at version 7.0.0[1], and there is seemlingly no plan to release
a patch version of Compose v1 to address the problem.

The official path forward is to use Compose v2, which is now bundled
with the Docker client and available on all platforms where Docker is
supported.

This commit additionally removes the 'version' attribute from Compose
files, since it was obsoleted in the Compose Spec[3].

Closes #1017

[1]: https://pypi.org/project/docker-compose/#history
[2]: docker/docker-py#3194
[3]: https://compose-spec.io
2024-09-17 09:20:56 +02:00

44 lines
1.2 KiB
YAML

# Example of Fleet-enrolled Elastic Agent pre-configured with an agent policy
# for running the APM Server integration (see kibana.yml).
#
# Run with
# docker compose \
# -f docker-compose.yml \
# -f extensions/fleet/fleet-compose.yml \
# -f extensions/fleet/agent-apmserver-compose.yml \
# up
services:
apm-server:
build:
context: extensions/fleet/
args:
ELASTIC_VERSION: ${ELASTIC_VERSION}
volumes:
- apm-server:/usr/share/elastic-agent/state:Z
environment:
FLEET_ENROLL: '1'
FLEET_TOKEN_POLICY_NAME: Agent Policy APM Server
FLEET_INSECURE: '1'
FLEET_URL: http://fleet-server:8220
# Enrollment.
# (a) Auto-enroll using basic authentication
ELASTICSEARCH_USERNAME: elastic
ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD:-}
# (b) Enroll using a pre-generated enrollment token
#FLEET_ENROLLMENT_TOKEN: <enrollment_token>
ports:
- 8200:8200
hostname: apm-server
# Elastic Agent does not retry failed connections to Kibana upon the initial enrollment phase.
restart: on-failure
networks:
- elk
depends_on:
- elasticsearch
- kibana
- fleet-server
volumes:
apm-server: