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

[Ingest Manager] Improve agent unenrollment with unenroll action #70031

Merged
merged 8 commits into from
Jul 3, 2020

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Jun 26, 2020

Summary

Resolve #67409

Change the unemrollment flow to let the time for agent to gracefully terminate.

Introduce a new agent action UNENROLL.

The endpoint to unenroll now accept a force: boolean to unenroll an agent with a gracefull unenrollment or an immediate one.

Agent unenrollment:

  1. POST /agents/{agentId}/unenroll -> create an UNENROLL action
  2. Agent checkin and get the action -> call endpoint to desinstall, ...
  3. Agent ack the UNENROLL action -> fleet invalidate all the agent API keys.

as discussed with @ruflin If an error occurs during unenrollment user will need to call fleet APIs

POST /agents/{agentId}/unenroll
{force: true}

UI Changes

2020-07-02 09-38-45 2020-07-02 09_51_21

How to test this

You can use this branch to build a compatible agent elastic/beats#19507
Or you can manually do the API requests to enroll/checkin/ack an agent

@nchaulet nchaulet added v8.0.0 v7.9.0 Team:Fleet Team label for Observability Data Collection Fleet team Ingest Management:beta1 labels Jun 26, 2020
@nchaulet nchaulet self-assigned this Jun 26, 2020
@nchaulet nchaulet force-pushed the feature-gracefull-unenrollment branch from 6d55f54 to 06579cd Compare June 30, 2020 14:11
@nchaulet nchaulet marked this pull request as ready for review July 2, 2020 13:52
@nchaulet nchaulet requested a review from a team July 2, 2020 13:52
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

@michalpristas
Copy link

Not a draft: Ready for tests again?

@nchaulet nchaulet added the release_note:skip Skip the PR/issue when compiling release notes label Jul 2, 2020
@nchaulet
Copy link
Member Author

nchaulet commented Jul 2, 2020

@michalpristas yes ready to test again :)

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code and tests LGTM. 👍 once CI is green

@@ -3520,7 +3520,17 @@
]
}
},
"/fleet/agents/unenroll": {
"/fleet/agents/{agentId}/unenroll": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

x-pack/test/api_integration/apis/fleet/agent_flow.ts Outdated Show resolved Hide resolved
nchaulet and others added 3 commits July 2, 2020 11:23
They were added to `AgentBase` in the TS so they end up in `Agent`.

Committing directly since I couldn't add a suggestion and a PR seemed heavy. Revert/delete if there's any problem.
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@michalpristas
Copy link

Tested OK,
agent disappears after UNENROLL is ACKed

@nchaulet nchaulet merged commit 72b3004 into elastic:master Jul 3, 2020
@nchaulet nchaulet deleted the feature-gracefull-unenrollment branch July 3, 2020 12:23
nchaulet added a commit to nchaulet/kibana that referenced this pull request Jul 3, 2020
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 3, 2020
* master: (199 commits)
  [Telemetry] Add documentation about Application Usage (elastic#70624)
  [Ingest Manager] Improve agent unenrollment with unenroll action (elastic#70031)
  Handle timeouts on creating templates (elastic#70635)
  [Lens] Add ability to set colors for y-axis series (elastic#70311)
  [Uptime] Use elastic charts donut (elastic#70364)
  [Ingest Manager] Update registry URL to point to snapshot registry (elastic#70687)
  [Composable template] Create / Edit wizard (elastic#70220)
  [APM] Optimize services overview (elastic#69648)
  [Ingest Pipelines] Load from json (elastic#70297)
  [Rum Dashbaord] Rum selected service view (elastic#70579)
  [Uptime] Prevent duplicate requests on load for index status (elastic#70585)
  [ML] Changing shared module setup function parameters (elastic#70589)
  [Ingest Manager] Add ability to sort to agent configs and package configs (elastic#70676)
  [Alerting] document requirements for developing new action types (elastic#69164)
  Fixed adding an extra space character on selecting alert variable in action text fields (elastic#70028)
  [Maps] show vector tile labels on top (elastic#69444)
  chore(NA): upgrade to lodash@4 (elastic#69868)
  Add Snapshot Restore README with quick-testing steps. (elastic#70494)
  [EPM] Use higher priority than default templates (elastic#70640)
  [Maps] Fix cannot select Solid fill-color when removing fields (elastic#70621)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 3, 2020
* master:
  [Lens] Fitting functions (elastic#69820)
  [Telemetry] Add documentation about Application Usage (elastic#70624)
  [Ingest Manager] Improve agent unenrollment with unenroll action (elastic#70031)
  Handle timeouts on creating templates (elastic#70635)
  [Lens] Add ability to set colors for y-axis series (elastic#70311)
  [Uptime] Use elastic charts donut (elastic#70364)
  [Ingest Manager] Update registry URL to point to snapshot registry (elastic#70687)
  [Composable template] Create / Edit wizard (elastic#70220)
  [APM] Optimize services overview (elastic#69648)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ingest Manager] Improve agent unenrollment
7 participants