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

[Meta] Remove Elastic Agent V1 control protocol #32

Open
6 of 11 tasks
jlind23 opened this issue May 25, 2022 · 9 comments
Open
6 of 11 tasks

[Meta] Remove Elastic Agent V1 control protocol #32

jlind23 opened this issue May 25, 2022 · 9 comments
Assignees
Labels
impact:critical Immediate priority; high value or cost to the product. Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team v8.5.0

Comments

@jlind23
Copy link
Contributor

jlind23 commented May 25, 2022

Now that the V2 protocol is out from 8.3 on, the V1 will not be updated and thus removed in a few releases. (Around end of 2022)

https://docs.google.com/document/d/1wqBWAhFdao93h2SE__koisuOOMGbwA5DTXDVFSKFYBs/edit

Parallel

Sequential

  • Implement validation and reading of the V2 binary specification
  • Implement V2 control protocol server in Elastic Agent
  • Parse Elastic Agent policy with V2 binary specification to spawn Units and be controlled through the V2 protocol
@jlind23 jlind23 added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team impact:critical Immediate priority; high value or cost to the product. labels May 25, 2022
@jlind23
Copy link
Contributor Author

jlind23 commented May 25, 2022

@pierrehilbert this is something you should read and take into consideration for the next upcoming releases.

@ph ph assigned ph and unassigned ph May 25, 2022
@jlind23 jlind23 added the v8.4.0 label May 25, 2022
@michalpristas michalpristas self-assigned this Jun 2, 2022
@michalpristas michalpristas changed the title Remove Elastic Agent V1 control protocol [Meta] Remove Elastic Agent V1 control protocol Jun 3, 2022
@michalpristas
Copy link
Contributor

who;s in charge of Change all beats to start without reading a configuration file from the disk (preferably they should start, context to control protocol and wait for initial configuration) ?

@ph
Copy link
Contributor

ph commented Jun 7, 2022

That should be on data plane team @cmacknz its closely related to the libbeat changes.

@cmacknz
Copy link
Member

cmacknz commented Jun 7, 2022

Yes, we can help with changing how the beats start up under agent. None of us are particularly familiar with how beats run under agent yet though, so if you can send us a detailed issue about what to change it would be greatly appreciated.

The same for Change beats to understand configuration directly from policy (all rules are removed in the V2 binary specification). I know we are relying on rules for filebeat and metricbeat but we didn't write the spec files originally.

@michalpristas
Copy link
Contributor

i can write something up about how config is loaded now and what needs to be changed tomorrow

@michalpristas
Copy link
Contributor

michalpristas commented Jun 9, 2022

@cmacknz

Beats behavior change

Current

At the moment we handle process as this:

  • elastic agent starts
  • elastic agent is notified about or detects config change
  • elastic agent creates a specific change for specific beats (let's assume filebeat from now on)
  • elastic agent starts filebeat process with -management.enabled flag
  • filebeat process starts
  • filebeat loads a config from filebeat.yml
	cfg, err := cfgfile.Load("", settings.ConfigOverrides)
	if err != nil {
		return fmt.Errorf("error loading config file: %w", err)
	}
  • filebeat initializes manager to get comms with agent going
	// initialize config manager
	b.Manager, err = management.Factory(b.Config.Management)(b.Config.Management, reload.Register, b.Beat.Info.ID)
	if err != nil {
		return err
	}
  • filebeat fetches config from fleet

Proposed

  • elastic agent starts
  • elastic agent is notified about or detects config change
  • elastic agent creates a specific change for specific beats (let's assume filebeat from now on)
  • elastic agent starts filebeat process with -management.enabled flag
  • filebeat process starts
  • in case management.enabled flag is not set filebeat loads a config from filebeat.yml otherwise use sane default configuration
	cfg, err := cfgfile.Load("", settings.ConfigOverrides)
	if err != nil {
		return fmt.Errorf("error loading config file: %w", err)
	}
  • filebeat initializes manager to get comms with agent going
	// initialize config manager
	b.Manager, err = management.Factory(b.Config.Management)(b.Config.Management, reload.Register, b.Beat.Info.ID)
	if err != nil {
		return err
	}
  • filebeat fetches config from fleet

@cmacknz
Copy link
Member

cmacknz commented Jun 9, 2022

Thanks! I've created two issues to track the needed work in beats and updated this issue description to track them:

For migrating to the V2 specification file/removing config transformations I've only considered filebeat and metricbeat since those are the only beats we own. They are also probably the most work to port.

@ph
Copy link
Contributor

ph commented Jun 13, 2022

@cmacknz AFAIK Auditbeat should behave the same as metricbeat I believe it inherit all the same runtime, we would need to solve it for packetbeat too.

@cmacknz
Copy link
Member

cmacknz commented Jun 23, 2022

Issue to migrate libbeat to the V2 protocol: elastic/beats#32078

v1v pushed a commit to v1v/elastic-agent-client that referenced this issue Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:critical Immediate priority; high value or cost to the product. Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team v8.5.0
Projects
None yet
Development

No branches or pull requests

5 participants