Skip to content

Update Cloud plugin to handle new config in kibana.yml#95569

Merged
ryankeairns merged 6 commits intoelastic:masterfrom
ryankeairns:rk/93436-cloud-urls
Mar 31, 2021
Merged

Update Cloud plugin to handle new config in kibana.yml#95569
ryankeairns merged 6 commits intoelastic:masterfrom
ryankeairns:rk/93436-cloud-urls

Conversation

@ryankeairns
Copy link
Copy Markdown
Contributor

@ryankeairns ryankeairns commented Mar 26, 2021

Closes #93436
Relates to https://github.com/elastic/cloud/pull/77420 https://github.com/elastic/cloud/pull/77961

Caveat

⚠️ Since the original work here originated with Core UI, I felt obliged to move this along. It's in a functioning and passing state, but will likely need some engineering help to get over the line. In particular, there may be a need for additional tests here, but I'm not versed in writing them.

Summary

The Cloud plugin was designed to support the below config values in anticipation of them being provided by ESS/ECE. Now that the Cloud team has completed their work (PRs above), we need to adjust the plugin to handle the final names + additional values.

Old config

# Enable cloud plugin
xpack.cloud.id: 'eastus2.azure.elastic-cloud.com:9243$59ef636c6917463db140321484d63cfa$a8b109c08adc43279ef48f29af1a3911'
xpack.cloud.resetPasswordUrl: 'https://cloud.elastic.co/user/settings' # Cloud profile link
xpack.cloud.accountUrl: 'https://cloud.elastic.co/account/activity' # Account link
xpack.cloud.deploymentUrl: 'https://cloud.elastic.co/deployments/resolve/cluster/eastus2/9243$59ef636c6917463db140321484d63cfa/'

New config

# USER OVERRIDES
# other properties
xpack.cloud.id: 'eastus2.azure.elastic-cloud.com:9243$59ef636c6917463db140321484d63cfa$a8b109c08adc43279ef48f29af1a3911'
xpack.cloud.profile_url: "/user/settings/"
xpack.cloud.organization_url: "/account/"
xpack.cloud.cname: "cloud.elastic.co"
xpack.cloud.base_url: "https://cloud.elastic.co"
xpack.cloud.deployment_url: "/deployments/bfdad4ef99a24212a06d387593686d63"
# END USER OVERRIDES

Items of note

  • With the base url split apart, this PR does some concatenating to arrive at the full URLs
  • While the config values are snake_case, I've attempted to make the plugin return camelCase variables. Some plugins were already relying on a camelCase `deploymentUrl' and this format seems like the preferred convention for Kibana.
  • The examples show cloud.elastic.co as the cname. This value will change for ECE installations where the value is user-defined.
  • A few new, previously unanticipated yet welcome, values are now being passed. I've gone ahead and opened those up (i.e. have the Cloud plugin provide them) so as not to require additional, follow-on PRs to expose them.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@ryankeairns
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@ryankeairns
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@ryankeairns ryankeairns marked this pull request as ready for review March 30, 2021 13:59
@ryankeairns ryankeairns requested a review from a team March 30, 2021 13:59
@ryankeairns ryankeairns requested review from a team as code owners March 30, 2021 13:59
@ryankeairns ryankeairns added v7.13.0 v8.0.0 release_note:feature Makes this part of the condensed release notes labels Mar 30, 2021
Copy link
Copy Markdown
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enterprise Search changes LGTM - thanks for grabbing that!

Copy link
Copy Markdown
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for working on this, @ryankeairns! ES UI changes LGTM 👍

Copy link
Copy Markdown
Member

@legrego legrego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security changes LGTM

Copy link
Copy Markdown
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it's LGTM.

Now the real question is: which version is https://github.com/elastic/cloud/pull/77420 going to impact? Will cloud correctly deploy/use this new format only on Kibana 7.13 and higher?

@ryankeairns
Copy link
Copy Markdown
Contributor Author

Technically it's LGTM.

Now the real question is: which version is elastic/cloud#77420 going to impact? Will cloud correctly deploy/use this new format only on Kibana 7.13 and higher?

I posed the same question and it is my understanding that, yes, it would target 7.13 and higher. I believe this to part of the reason that @yspotts reverted his PR. Anyway, one final confirmation would be good.

Also, thanks for the review.

@yspotts
Copy link
Copy Markdown

yspotts commented Mar 30, 2021

Technically it's LGTM.
Now the real question is: which version is elastic/cloud#77420 going to impact? Will cloud correctly deploy/use this new format only on Kibana 7.13 and higher?

I posed the same question and it is my understanding that, yes, it would target 7.13 and higher. I believe this to part of the reason that @yspotts reverted his PR. Anyway, one final confirmation would be good.

Also, thanks for the review.

yes, my (reverted) PR targets 7.13 and higher only. Once this is merged, I will merge the cloud side.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cloud 7 8 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.0MB 2.0MB -5.0B
indexLifecycleManagement 240.1KB 240.1KB -5.0B
total -10.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
cloud 4.5KB 4.9KB +435.0B
security 122.9KB 122.8KB -102.0B
total +333.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@yspotts
Copy link
Copy Markdown

yspotts commented Mar 31, 2021

@ryankeairns now that this is merged, I guess we are ready re-merge my PR on the cloud side? Maybe we should wait a day until kibana builds are created to accept these new properties?

ryankeairns added a commit to ryankeairns/kibana that referenced this pull request Mar 31, 2021
* Handle cloud urls from kibana.yml

* Add types to utils params

* Update utils

* address nits

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
ryankeairns added a commit that referenced this pull request Mar 31, 2021
* Handle cloud urls from kibana.yml

* Add types to utils params

* Update utils

* address nits

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@ryankeairns
Copy link
Copy Markdown
Contributor Author

@ryankeairns now that this is merged, I guess we are ready re-merge my PR on the cloud side? Maybe we should wait a day until kibana builds are created to accept these new properties?

@yspotts Yes, we are good to go (I was out on vacation recently). Have you re-merged your PR?

cc:/ @alexfrancoeur

@yspotts
Copy link
Copy Markdown

yspotts commented Apr 13, 2021

@ryankeairns now that this is merged, I guess we are ready re-merge my PR on the cloud side? Maybe we should wait a day until kibana builds are created to accept these new properties?

@yspotts Yes, we are good to go (I was out on vacation recently). Have you re-merged your PR?

cc:/ @alexfrancoeur

thanks! Just merged today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Home Kibana home application release_note:feature Makes this part of the condensed release notes v7.13.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Cloud plugin to handle new URLs

8 participants