diff --git a/apm/.dockerignore b/apm/.dockerignore new file mode 100644 index 0000000..37eef9d --- /dev/null +++ b/apm/.dockerignore @@ -0,0 +1,6 @@ +# Ignore Docker build files +Dockerfile +.dockerignore + +# Ignore OS artifacts +**/.DS_Store diff --git a/apm/Dockerfile b/apm/Dockerfile new file mode 100644 index 0000000..7b758fa --- /dev/null +++ b/apm/Dockerfile @@ -0,0 +1,7 @@ +ARG ELASTIC_VERSION + +# https://www.docker.elastic.co/ +FROM docker.elastic.co/elastic-agent/elastic-agent:${ELASTIC_VERSION:-8.15.1} + +# Add your kibana plugins setup here +# Example: RUN kibana-plugin install diff --git a/docker-compose.yml b/docker-compose.yml index e7c07b9..82f2be1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,6 +104,31 @@ services: - elasticsearch restart: unless-stopped + fleet-server: + build: + context: apm/ + args: + ELASTIC_VERSION: ${ELASTIC_VERSION} + #volumes: + # - ./apm/config/apm-server.yml:/usr/share/kibana/config/kibana.yml:ro,Z + ports: + - 8220:8220 + - 8200:8200 + environment: + KIBANA_PASSWORD: ${KIBANA_SYSTEM_PASSWORD:-} + KIBANA_FLEET_PASSWORD: ${KIBANA_SYSTEM_PASSWORD:-} + FLEET_SERVER_ENABLE: 1 + ELASTICSEARCH_PASSWORD: ${ELASTIC_PASSWORD:-} + KIBANA_FLEET_SETUP: 1 + FLEET_ENROLL: 1 + FLEET_INSECURE: true + FLEET_SERVER_POLICY_ID: fleet-server-policy + networks: + - elk + depends_on: + - elasticsearch + restart: unless-stopped + networks: elk: driver: bridge diff --git a/elasticsearch/config/elasticsearch.yml b/elasticsearch/config/elasticsearch.yml index d66f071..4243d38 100644 --- a/elasticsearch/config/elasticsearch.yml +++ b/elasticsearch/config/elasticsearch.yml @@ -8,5 +8,5 @@ network.host: 0.0.0.0 ## X-Pack settings ## see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-settings.html # -xpack.license.self_generated.type: trial +xpack.license.self_generated.type: basic xpack.security.enabled: true diff --git a/kibana/config/kibana.yml b/kibana/config/kibana.yml index ef3f024..e536827 100644 --- a/kibana/config/kibana.yml +++ b/kibana/config/kibana.yml @@ -72,19 +72,6 @@ xpack.fleet.agentPolicies: - name: docker-1 package: name: docker - - name: Agent Policy APM Server - id: agent-policy-apm-server - description: Static agent policy for the APM Server integration - monitoring_enabled: - - logs - - metrics - package_policies: - - name: system-1 - package: - name: system - - name: elastic_agent-1 - package: - name: elastic_agent - name: apm-1 package: name: apm