-
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 support for fleet server urls #94364
Conversation
Pinging @elastic/fleet (Team:Fleet) |
@@ -10,9 +10,11 @@ import type { SavedObjectAttributes } from 'src/core/public'; | |||
export interface BaseSettings { | |||
agent_auto_upgrade: boolean; | |||
package_auto_upgrade: boolean; | |||
has_seen_add_data_notice?: boolean; | |||
fleet_server_urls: string[]; | |||
// TODO remove as part of https://github.com/elastic/kibana/issues/94303 |
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.
This is great, we should add it in more place to make the cleanup easier and not forget things.
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.
I have tested this change locally with my changes to Elastic Agent (elastic/beats#24713).
I was able to switch between 2 different Fleet Servers by adjusting the URL in the Settings flyout.
86e6b4e
to
5ca883e
Compare
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
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.
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Show resolved
Hide resolved
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.
Found 1 more small thing
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.
This is an initial code read review, will come back and do local testing.
I was wondering your thoughts on urls
vs hosts
, we have used both interchangeably for Kibana url/hosts support. @hbharding maybe you can weigh in on the UX side on rationale of surfacing one vs the other term in the UI. I was thinking hosts
might be more consistent with other parts of the stack, such as Kibana's elasticsearch.hosts
setting, but I'm not aware of many other examples.
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/components/settings_flyout/confirm_modal.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/fleet/public/applications/fleet/layouts/default.tsx
Outdated
Show resolved
Hide resolved
193f128
to
2e52470
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.
Tested locally and the main behavior works as expected, I see fleet.hosts
populated in the agent yaml when I change the setting. I am approving but I would like to get consensus on urls
vs hosts
before this gets merged. It's a little strange that the setting goes from fleet_server.hosts
to -> fleet_server_urls
and back to -> fleet.hosts
in the end.
Small UI suggestion, I think we should add the same non-empty validation for Fleet server & Elasticsearch URL inputs as we currently do for Kibana URLs, currently they don't any show any errors when trying to save with empty values:
return ( | ||
<EuiText size="s" color={item.direction === 'added' ? 'secondary' : 'danger'}> | ||
{item.urls.map((url) => ( | ||
<div key={url}>{url}</div> |
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.
unlikely that the user will enter the same URL twice, but it might be safer to key on index
throw new Error('kibana_urls is missing'); | ||
|
||
fullAgentPolicy.fleet = { | ||
hosts: settings.kibana_urls, |
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.
is it expected to have fleet.hosts
be kibana URLs when there there aren't any fleet server urls configured yet? i guess this is temporary until we remove kibana URLs support?
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.
Yes that correct agent 7.13 will only support fleet.hosts
even for Kibana during a short period to not break all of our CI
Thanks for raising the inconsistency on 👍 I'm pro cc @mostlyjason for awareness. |
I plan to add this as soon as we remove the Kibana URL I added a comment in the code for that. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: cc @nchaulet |
Co-authored-by: Nicolas Chaulet <[email protected]>
Hi @EricDavisX We have created 02 testcases for above merged PR. Test-cases link are as follows: Further we have updated 13 testcases under Ingest Manager Test suite Section: Fleet Settings. Please let us know if we have missed anything to put down in expected result. Thanks |
Summary
Resolve #89442
Allow to configure Fleet server urls, (still support Kibana url) when Fleet server url is configured this settings will be used instead of the Kibana url.
The removal of the Kibana url will be done in a following PRs once all of our CI, e2e tests run Fleet server.
UI Changes
The UI implement the new design from here #94624
How to tests
You can test the UI, and that the policy generated contains
fleet.hosts
the end to end tests with fleet server is a little complicated now and I am trying to have easier way to run fleet server locally