elastic / elastic/elastic-agent
Add instructions to what need to `volumes` in the documentation for containerized deployments
- Dominant language
- Go
- Stars
- 275
- Forks
- 264
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 303
Description
**Describe the enhancement:**
Add instructions to mount `/var/run/docker.sock` and more about `volumes` in the documentation for containerized deployments.
**Describe a specific use case for the enhancement or feature:**
- Assume that there is already an `ElatsicSearch` and `Kibana` instance locally, and `Elastic Agent` is being configured.
```yaml
version: "3.8"
services:
elasticsearch-node01:
image: elastic/elasticsearch:8.1.2
environment:
bootstrap.memory_lock: true
ELASTIC_PASSWORD: "1234AF57-35CA-B2E0-BE8B-12345D5C929E"
volumes:
- elasticsearch-data01:/usr/share/elasticsearch/data
- elasticsearch-config01:/usr/share/elasticsearch/config:rw
ports:
- "9200:9200"
- "9300:9300"
ulimits:
memlock:
soft: -1
hard: -1
kibana:
image: elastic/kibana:8.1.2
environment:
XPACK_SECURITY_ENCRYPTIONKEY: fc12345ea123eb1234dac7b12345ac12e
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: 1bb12c4e9ed1c12ae4a8ead1234567f1
XPACK_REPORTING_ENCRYPTIONKEY: af5cbdd2e2f4da12a72f12f1e123456f
ports:
- "5601:5601"
volumes:
- kibana-data:/usr/share/kibana/data
- kibana-config:/usr/share/kibana/config
elastic-agent-node01:
image: elastic/elastic-agent:8.1.2
restart: always
user: root
environment:
FLEET_SERVER_ENABLE: true
FLEET_SERVER_ELASTICSEARCH_HOST: https://172.20.0.2:9200
FLEET_SERVER_SERVICE_TOKEN: "AAEAAWVsYXN0aWMvZmxlZXQtc2VydmVyL3Rva2VuLTE2NDkzMzUzMjQ5NzY6Q09FUU92aVpSRHl4QmVuNGRkQ2ctdw"
FLEET_SERVER_POLICY_ID: fleet-server-policy
FLEET_SERVER_ELASTICSEARCH_CA_TRUSTED_FINGERPRINT: "64f60363137d9620b7b864b145823e2ddb195634768c37886cfd26d6e10a1e7a"
FLEET_SERVER_INSECURE_HTTP: true
```
- When deploying Elastic Agent when configuring Fleet, there will be an unintuitive log in the docker log.
```shell
{"log.level":"warn","@timestamp":"2022-04-07T13:25:03.974Z","log.logger":"tls","log.origin":{"file.name":"tlscommon/tls_config.go","file.line":105},"message":"SSL/TLS verifications disabled.","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-07T13:25:04.224Z","log.logger":"composable.providers.docker","log.origin":{"file.name":"docker/docker.go","file.line":43},"message":"Docker provider skipped, unable to connect: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2022-04-07T13:25:04.225Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":62},"message":"Starting stats endpoint","ecs.version":"1.6.0"}
```
- This is implying that the user mounts `/var/run/docker.sock:/var/run/docker.sock`, but there is no related introduction in https://www.elastic.co/guide/en/fleet/8.1/elastic-agent-container.html .
- At the same time, the documentation does not mention `volumes` mounts like `elastic-agent-log:/usr/share/elastic-agent/state/data/logs` to persist logs. `Elastic Agent` itself has the function of collecting system information, but the documentation does not indicate what directory should be mounted to help `Elastic Agent` collect information. I think this is an improvement point for the documentation .
Contributor guide
Research direction
Start with the Elastic Agent container deployment documentation at the linked elastic.co guide and compare it with the Docker Compose example and logs in this issue. Document the relevant /var/run/docker.sock and volume mounts, including persistence and host-collection guidance, so the containerized deployment instructions cover the reported setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose
- Domain
- devops, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100