-
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 preconfiguration to kibana config #96588
Conversation
@simitt Basics of this PR are working if you'd like to check out the feature branch and test with cloud stuff. Config format looks like: xpack.fleet.packages:
- name: apache
version: 0.3.4
xpack.fleet.agentPolicies:
- name: Preconfigured Policy
id: 1
namespace: test
package_policies:
- package:
name: system
name: System Integration
inputs:
- type: system/metrics
enabled: true
vars:
- name: system.hostfs
value: home/test
streams:
- data_stream:
dataset: system.core
enabled: true
vars:
- name: period
value: 20s
- type: winlog
enabled: false Ping me if you've got questions. |
Pinging @elastic/fleet (Feature:Fleet) |
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.
kibana-docker changes LGTM
…preconfig # Conflicts: # x-pack/plugins/fleet/server/services/package_policy.ts
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.
It works as expected 🚀 I have two questions:
-
Should we use saved object to save deleted policies? it come with a lot of things migration, schema, ...
-
I am wondering if we should use this and default values to create the default and default fleet server policy, it will simplify a lot our code, and we will have only one way to configure preconfigured policy, (this can be done in a following PR to keep that one small and readable)
@Zacqary I played around with this a bit and the preconfigured agent policies and packages were set up 🎉 . I did also run into a couple of issues though and just leaving my observations here: Encountered Errors
The package name should be
If this happens - is there any other way for the user to resolve this issue than to change the Questions ans Observations
|
@simitt the error you encoutered is because of a typo in the package name |
Agree, we should have a better error for this situation. Unfortunately it's happening because the code is creating a package key called Out of scope for this PR, I think. We can file a new issue.
No, there's no way to resolve this in the UI. I can add better error handling for this.
Yes, add the
We didn't plan on that. The defaults are hard-coded but the user can override them in xpack.fleet.agentPolicies:
- name: Default Fleet Server Override
id: default-fleet-server
is_default_fleet_server: true If you think it'd be valuable to include these policies in EDIT: I realized there's a bug in this; the plugin setup ensures the default policies before reading from
I believe it's - data_stream:
dataset: dataset.name
namespace: some-namespace
vars:
...
@ruflin Is this an okay change to make? I know we wanted to keep things predictable by requiring the user to specify a version.
I was under the impression that input names are hard-coded in the integration manifest and can't be changed by the user. Is that incorrect?
At the moment there's no update or overwrite support, just creating new policies. If this is important we can prioritize it.
Did you set a new policy |
I'm pushing a fix so that we can successfully use |
I think it would make sense yes to have everything defined as the default kibana config value, and if you want to override you can do whatever you want, and this way there is only one way to create predefined config |
@simitt I prefer to keep a predefined version and not latest to have it more predictable. It means at the moment we would need to update the Kibana stack pack for each version at least until there is an other solution. Are you ok with that? |
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.
Looks good to me as soon as the CI pass
@simitt Preconfiguration errors will now be thrown as toasts instead of blocking the Fleet UI |
Not with how it is currently working. When configuring Update: since the errrors are not blocking anymore, updated this comment. |
@Zacqary thanks for the answers and changes. I tested again, and apart from the |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @Zacqary |
I believe with Fleet Server the problem is that it gets installed already for the default policies, before the configured policy gets picked up to be installed. IMO installing outdated packages should always be allowed, especially if one cannot specify a |
@simitt Outdated packages can be installed with the xpack.fleet.packages:
- name: fleet-server
version: 0.2.0
force: true I'm going to merge this since that's already an option, but if that's still problematic for cloud users who can't edit their config, we can discuss making |
Summary
Closes #96370
Enables using the preconfiguration API in kibana.yml.
Also fixes the following bugs:
preconfiguration_id
. You'll need to change thepreconfiguration_id
to recreate a policy.Testing
Add this to your
kibana.dev.yml
:Checklist