Skip to content

Commit

Permalink
feat: Adding combined fleet and apm-server container
Browse files Browse the repository at this point in the history
This modifies the fleet-server-policy so that the agent-policy-apm-server
policy and separate agent is no longer needed. The agent is launched by
the docker-compose.yml too.

The elasticsearch license has been changed from trial to basic so that the
deployment won't age out.
  • Loading branch information
NickPoole committed Sep 30, 2024
1 parent 6edae96 commit 2e9e1cd
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 14 deletions.
6 changes: 6 additions & 0 deletions apm/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore Docker build files
Dockerfile
.dockerignore

# Ignore OS artifacts
**/.DS_Store
7 changes: 7 additions & 0 deletions apm/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <name|url>
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/config/elasticsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 0 additions & 13 deletions kibana/config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e9e1cd

Please sign in to comment.