Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to provide the agent-id in enroll API #4226

Open
blakerouse opened this issue Dec 17, 2024 · 2 comments
Open

Add ability to provide the agent-id in enroll API #4226

blakerouse opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@blakerouse
Copy link
Contributor

Describe the enhancement:

Add the ability to specify the agent-id of the enrolling Elastic Agent.

Describe a specific use case for the enhancement or feature:

On serverless, an Elastic Agent is static but the pod doesn't have any persistent storage so it cannot store the enrollment information between restarts of the Elastic Agent. There have also been other reports of this issue from customers where they do not need persistent storage from the integration and requiring the Elastic Agent to have it just for the enrollment information is not possible.

To provide a stable Elastic Agent in the agents list in Kibana, this would allow an Elastic Agent to enroll with the ID they want to have. This would also replace an existing Elastic Agent if one already has the same ID.

This does open the possibility that two Elastic Agent's are communicating to Fleet Server as the same agents. This is acceptable for a moment in-time, like when a new pod rolling out before the old pod is stopped. Running two concurrent Elastic Agent's at the same time would be possible, and would result in undefined behavior and would not be recommended.

@michel-laterman
Copy link
Contributor

I think we already provide this through the enrollment_id in the API:

enrollment_id:
type: string
description: |
The enrollment ID of the agent.
To replace an agent on enroll fail.
The existing agent with a matching enrollment_id will be deleted if it never checked in. The new agent will be enrolled with the enrollment_id.

It was added with #2655

@blakerouse
Copy link
Contributor Author

@michel-laterman The existing agent with a matching enrollment_id will be deleted if it never checked in. What if it has checked-in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

No branches or pull requests

2 participants