-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[WIP] POC cloud migration plugin #46448
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
Conversation
|
Pinging @elastic/es-ui |
💔 Build Failed |
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.
Great work, Seb! I'm going to borrow a ton of the app boilerplate code when I set up a skeleton app for future work on a Tasks app. I glanced through the code and had a couple questions.
| features.monitoring && features.monitoring.available && features.monitoring.enabled | ||
| ), | ||
| }, | ||
| geoLocalisation: { |
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.
Americans would tend to expect this to be spelled geoLocalization, though I'm not sure if we want to standardize on the American idiom.
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.
Let's wait and see what Andrew from cloud says about this. The contract hasn't been defined yet, this might end up being simply geo.
|
|
||
| const { | ||
| data: { country, continent }, | ||
| } = await axios.get(`http://www.iplocate.io/api/lookup/${ip}`, axiosOptions); |
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.
Will the /cluster/state route fail if the ipinfo or iplocate services are unavailable? Is that what we want?
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 a quick draft I made to get the server location. The /cluster/state route should, of course, be resilient to the geo info lookup failing.
I want to see first if this is something we want, and if we do, if using a public endpoint is OK with the security team. I had to use the http scheme as the https was blocked by Kibana as not being whitelisted.
|
|
||
| export function mirrorPluginStatus(upstreamPlugin, downstreamPlugin, ...statesToMirror) { | ||
| upstreamPlugin.status.setMaxListeners(20); // We need more than the default, which is 10 | ||
| upstreamPlugin.status.setMaxListeners(30); // We need more than the default, which is 10 |
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 no context here, so I'm curious what necessitated this change and whether it impacts other teams?
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.
So it seems that we reached the 20 limits and my plugin was going to 21. I changed it to 30 and everything worked fine. You are right that we might want to ask what impact this could have on Kibana in general.
| <Form form={form}> | ||
| <UseField | ||
| path="cloudClusterConfig" | ||
| config={fieldConfig} |
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 a good example of when to use the config prop for <UseField />.
In this tiny form, using a form schema would be overkill. Now that I see it, I could have called it textAreaFieldConfig.
💔 Build Failed |
| }; | ||
| const { | ||
| data: { ip }, | ||
| } = await axios.get('http://ipinfo.io', axiosOptions); |
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.
Might be worth considering moving to the core.http.fetch service. I believe it's available as part of HttpStart but if it isn't, you could use node-fetch to start with and then migrate to core.http.fetch when it's available.
kibana/src/core/public/http/types.ts
Line 36 in de5c452
| fetch: HttpHandler; |
This PR contains the WIP of the cloud migration plugin. It is a POC to work on the first part of the migration: initialize a Cloud cluster based on the local cluster stats.