elastic / elastic/elastic-agent
Improve developer documentation for agent + beats
- Dominant language
- Go
- Stars
- 275
- Forks
- 264
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 298
Description
In the context of Elastic Agent, as integration developers and testers, we need a way to run the Agent with custom metricbeat versions/builds for debugging and testing purposes.
At the moment the resources for this are generally not available and resort mostly around asking. This issue should act as a placeholder where to aggregate this information. The end goal is to consolidate knowledge in an appropriate place.
**Strategies to run custom beats with Agent**
1. Build the agent and enroll it
2. Replace binaries in running Agent (Docker running container, host)
3. run the Agent/binaries supervised by the Agent with a debugger attached
4. ?
**Pain points to address**
* Binary signature check
* Local build with custom beat code (local changes)
**Related material**
[Building Agent (w/ Docker images)](https://github.com/elastic/beats/tree/main/x-pack/elastic-agent#testing)
Let the crowdsourcing begins! :)
---
# How to
_This section collects how tos currently in use_
## Build agent with customized beats
```
# linux build
$ EXTERNAL=false DEV=true SNAPSHOT=true PLATFORMS=linux/amd64 TYPES=docker mage package
# macos build
$ EXTERNAL=false DEV=true SNAPSHOT=true PLATFORMS=darwin/amd64 TYPES=docker mage package
```
## Build docker container with custom agent/beats
(follow Build agent with customized beats before this step)
```
$ docker build -t myagent ./build/package/elastic-agent/elastic-agent-linux-amd64.docker/docker-build
```
## Reloading agent image in kind
[kind](https://kind.sigs.k8s.io/) is a tool for running local Kubernetes clusters.
(follow Build docker container with custom agent/beats before this step)
```
kind load docker-image myagent
```
Contributor guide
Assessment
This issue has not been assessed yet.