-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Fleet] Add global component template to all fleet index templates #102225
[Fleet] Add global component template to all fleet index templates #102225
Conversation
dac3864
to
21c2a69
Compare
Pinging @elastic/fleet (Team:Fleet) |
21c2a69
to
b9b4144
Compare
Could we put this installation behind a config option? It should be turned on by default but I think we should offer users to turn it off. This also helps in the case we discover any issues with the installation mechanism, there is an opt out. On the upgrade path, can you make sure we follow up on this? I have the suspicion we need it sooner then we like. There is a downside to having the pipeline versioned. If it is not versioned, we could just overwrite it all the processing would use the new one. If we version it, we need to update all data streams. Maybe if the pipeline keeps the data the same, we just keep the version? But how will then the upgrade mechanism know to overwrite? |
Just added the For the migration If we want to only update the pipeline we can use the I am wondering this will be a good idea. If we have a migration system for Fleet close to the one we use for Saved object, with a version saved in one of our saved object, and based on that we can run migration function where we can do whatever we want, it probably can help for other things like endpoint migration between version too. (but there is a risk to have the ES assets out of sync with what we have if a user manually change them) |
Thanks for adding the config. Will this always install the assets but not just enable them? What if a user had it enabled and hits issues and wants to disable it, how does this work? For the upgrade: Happy to discuss it in a separate thread. |
Disabling the flag will not install the assets and not enable.
new package installation will not have it but old packages will have to be reinstalled to disable the component template. |
I'm a bit worried about the part that after disabling it is not really disabled. Is there an easy way for users to "reinstall" a package? |
Not really an easy way it's possible to reinstall the package via calling the API to install the package with force. If you think it's problematic I can do it in the setup call if we detect the flag is off and there is a component template we can clean everything. |
@nchaulet @jen-huang I suggest for now we get this PR in quickly so we have enough time to test and see if it causes any issue. If it does not have any issues we don't need to worry about the disable part. There is also a "hacky" way to disable it which is overwrite the pipeline with an empty pipeline in case of "emergency" ;-) |
…-global-component-template
@elasticmachine merge upstream |
…-global-component-template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM. Left two grammar-related suggestions. I'm w/ @ruflin re: merging and confirming behavior
Co-authored-by: John Schulz <[email protected]>
@elasticmachine merge upstream |
@elastic/ml-ui I add to modify an API test as it's required to setup fleet before installing a package. |
e345d60
to
e7c0e23
Compare
@elasticmachine merge upstream |
@nchaulet I just merged #101769 which means this PR needs the update you mentioned to prevent the global template from being removed. Hopefully the change is clear and simple enough, but please let me know if you have any questions or if I can help at all. |
f7c5b6f
to
27b292a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ML test changes LGTM
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
History
To update your PR or re-run it, just comment with: cc @nchaulet |
💔 Backport failed
To backport manually run: |
Description
Resolve #101309
With that PR
event.ingested
should be correctly mapped for all Fleet managed index template.This PR introduce a new global component template, that is added to all the index template installed by Fleet.
This component template set the final_pipeline to be a global fleet final pipeline that verify agent id against the used API key, and add the mappings for the fields added by the fleet final pipeline.
Assets naming, I choose to name the two assets like this (open to better naming, and to discuss the convention here)
.fleet_component_template-{version}
for the component template.fleet_final_pipeline-{version}
for the pipeline that check agent statusThe feature is expose behind a config flag
xpack.fleet.agentIdVerificationEnabled
by default set totrue
.How it works
The pipeline and the component template name contains a version so we can upgrade them in the future.
During the fleet setup, if the component template or the pipeline is not here we are going to:
Future upgrade (not implemented) can