Skip to content
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

[Remote clusters] Cloud deployment form when adding new cluster #94450

Merged
merged 46 commits into from
Apr 8, 2021

Conversation

yuliacech
Copy link
Contributor

@yuliacech yuliacech commented Mar 11, 2021

Summary

Addresses some of #90894
This PR adds a new input for Cloud (both ESS and ECE) users that allows them to configure a remote cluster with only a Cloud endpoint url (no need to fill out proxy address and server name). Also proxy mode that is default for Cloud is being forced in the form (no switch to sniff mode).

Screenshot

Screenshot 2021-04-12 at 17 29 22

Implementation

Remote clusters on Cloud context

  • only same environment connections are possible
  • only proxy mode is allowed
  • default port 9400 (that is not likely to change)
  • Cloud endpoint url can be used to fill proxy address and server name with following logic:
    • Cloud endpoint url = <protocol>://<domain>:<port>
    • proxy address = <domain>:9400
    • server name = <domain>

Cloud endpoint url input

Cluster New Edit
non-Cloud sniff + proxy mode, no Cloud url input sniff + proxy mode, no Cloud url input
Cloud proxy mode, Cloud url input enabled proxy mode, Cloud url input possibly enabled*

*logic for enabling Cloud url input when editing an existing cluster:

  • proxy address uses Cloud default port 9400
  • proxy address without port === server name

Screenshot and GIF

Screenshots Cloud url input enabled Screenshot 2021-04-12 at 17 31 50

Cloud url disabled
Screenshot 2021-04-12 at 17 31 58

GIF
Apr-12-2021.17-37-42.mp4

How to test

When running Kibana locally add a value for xpack.cloud.id to kibana.yml file to simulate Cloud environment

xpack.cloud.id: 'remote-deployment:dXMtY2VudHJhbDEuZ2NwLmZvdW5kaXQubm8kODU0NDAwYjA4OTJhNGFhMzk2M2ZhZTg0MzRiOGRhODEkZDVmZTQzZTFmZWM3NDljM2JhNDgyYTNlNTY5YmRjMTc='

Checklist

Release Note

It's now possible to configure a remote cluster on Cloud using only Cloud endpoint url.

@yuliacech yuliacech added release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.13.0 v8.0.0 labels Mar 11, 2021
@yuliacech yuliacech marked this pull request as ready for review March 11, 2021 16:58
@yuliacech yuliacech requested a review from a team as a code owner March 11, 2021 16:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

@zanbel
Copy link

zanbel commented Mar 15, 2021

Thanks, @yuliacech ! I think this approach works really nicely.

A couple of comments:

  • I noticed you used the term Elasticsearch endpoint URL in the connection mode description but the field name is Cloud deployment url. Maybe it will be easier for users if you use the same term. We should also use either URL or url.
  • The term Proxy address and Server name appear with an upper case in the info message but all lower cases in the toggle button.
  • Following some recent conversions, summarized by @juliocamarero here elastic/cloud#77079, we should be able to correctly configure the remote cluster when using an alias. Not sure if you want to address this scenario as part of this PR and update the info message or in a new one.

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech yuliacech requested a review from a team as a code owner March 16, 2021 14:47
Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Core changes LGTM!

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@mdefazio
Copy link
Contributor

Is there a reason we auto-open the flyout after adding a remote url? Is there a connection check that happens here?
Can we just show a toast indicating it was successfully? With the option to see details?

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech
Copy link
Contributor Author

Hi @mdefazio, the flyout opens automatically because the form redirects to the list with details view after a cluster is added successfully. This was not changed in this work but I'm happy to address your feedback in a separate PR. Should the form still redirect to the list view but display a toast notification instead of the details flyout? Or we could possibly disable the redirection all together, WDYT?

@kellyemurphy
Copy link
Contributor

@yuliacech , here's a quick mockup based on our conversation. I would recommend simply including the Elasticsearch logo as opposed to adding a screenshot. This would definitely still need copy review.

image

@mdefazio The logos in the Cloud UI are going away, in a future project.

As for the wording of the popover, AFAIK, we haven't done steps in a popover, ever. So I'd make it a simple sentence:
Go to the <<deployments page>>, select the remote deployment and copy the Elasticsearch endpoint URL.

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

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

Looks good. Sorry for any delay on checking the changes.

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech
Copy link
Contributor Author

@elasticmachine merge upstream

@yuliacech yuliacech merged commit 0316787 into elastic:master Apr 8, 2021
yuliacech added a commit to yuliacech/kibana that referenced this pull request Apr 8, 2021
…tic#94450)

* Implemented in-form Cloud deployment url input

* Fixed i18n files and added mode switch back for non-Cloud

* Added cloud docs link to the documentation service, fixed snapshot tests

* Fixed docs build

* Added jest test for the new cloud url input

* Added unit test for cloud validation

* Fixed eslint error

* Fixed ts errors

* Added ts-ignore

* Fixed ts errors

* Refactored connection mode component and component tests

* Fixed import

* Fixed copy

* Fixed copy

* Reverted docs changes

* Reverted docs changes

* Replaced the screenshot with a popover and refactored integration tests

* Added todo for cloud deployments link

* Changed cloud URL help text copy

* Added cloud base url and deleted unnecessary base path

* Fixed es error

* Fixed es error

* Changed wording

* Reverted docs changes

* Updated the help popover

* Deleted unneeded fragment component

* Deleted unneeded fragment component

* Updated tests descriptions to be more detailed

Co-authored-by: Kibana Machine <[email protected]>
yuliacech added a commit that referenced this pull request Apr 8, 2021
…) (#96558)

* Implemented in-form Cloud deployment url input

* Fixed i18n files and added mode switch back for non-Cloud

* Added cloud docs link to the documentation service, fixed snapshot tests

* Fixed docs build

* Added jest test for the new cloud url input

* Added unit test for cloud validation

* Fixed eslint error

* Fixed ts errors

* Added ts-ignore

* Fixed ts errors

* Refactored connection mode component and component tests

* Fixed import

* Fixed copy

* Fixed copy

* Reverted docs changes

* Reverted docs changes

* Replaced the screenshot with a popover and refactored integration tests

* Added todo for cloud deployments link

* Changed cloud URL help text copy

* Added cloud base url and deleted unnecessary base path

* Fixed es error

* Fixed es error

* Changed wording

* Reverted docs changes

* Updated the help popover

* Deleted unneeded fragment component

* Deleted unneeded fragment component

* Updated tests descriptions to be more detailed

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

kibanamachine commented Apr 12, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / general / X-Pack EPM API Integration Tests.x-pack/test/fleet_api_integration/apis/epm/list·ts.Fleet Endpoints EPM Endpoints EPM - list "before all" hook in "EPM - list"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:00:00]         └-: Fleet Endpoints
[00:00:00]           └-> "before all" hook in "Fleet Endpoints"
[00:00:00]           └-: EPM Endpoints
[00:00:00]             └-> "before all" hook in "EPM Endpoints"
[00:00:14]             └-: EPM - list
[00:00:14]               └-> "before all" hook in "EPM - list"
[00:00:14]               └-> "before all" hook in "EPM - list"
[00:00:14]                 │ info [fleet/empty_fleet_server] Loading "mappings.json"
[00:00:14]                 └- ✖ fail: Fleet Endpoints EPM Endpoints EPM - list "before all" hook in "EPM - list"
[00:00:14]                 │      ResponseError: resource_already_exists_exception
[00:00:14]                 │       at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
[00:00:14]                 │       at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
[00:00:14]                 │       at endReadableNT (internal/streams/readable.js:1327:12)
[00:00:14]                 │       at processTicksAndRejections (internal/process/task_queues.js:80:21)
[00:00:14]                 │ 
[00:00:14]                 │ 

Stack Trace

ResponseError: resource_already_exists_exception
    at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
    at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  meta: {
    body: { error: [Object], status: 400 },
    statusCode: 400,
    headers: {
      'content-type': 'application/json;charset=utf-8',
      'content-length': '405'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}

Kibana Pipeline / general / X-Pack EPM API Integration Tests.x-pack/test/fleet_api_integration/apis/epm/list·ts.Fleet Endpoints EPM Endpoints EPM - list "after all" hook in "EPM - list"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:00:00]         └-: Fleet Endpoints
[00:00:00]           └-> "before all" hook in "Fleet Endpoints"
[00:00:00]           └-: EPM Endpoints
[00:00:00]             └-> "before all" hook in "EPM Endpoints"
[00:00:14]             └-: EPM - list
[00:00:14]               └-> "before all" hook in "EPM - list"
[00:00:14]               └-> "before all" hook in "EPM - list"
[00:00:14]                 │ info [fleet/empty_fleet_server] Loading "mappings.json"
[00:00:14]                 └- ✖ fail: Fleet Endpoints EPM Endpoints EPM - list "before all" hook in "EPM - list"
[00:00:14]                 │      ResponseError: resource_already_exists_exception
[00:00:14]                 │       at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
[00:00:14]                 │       at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
[00:00:14]                 │       at endReadableNT (internal/streams/readable.js:1327:12)
[00:00:14]                 │       at processTicksAndRejections (internal/process/task_queues.js:80:21)
[00:00:14]                 │ 
[00:00:14]                 │ 
[00:00:14]                 └-> "after all" hook in "EPM - list"
[00:00:14]                   │ info [fleet/empty_fleet_server] Loading "mappings.json"
[00:00:14]                   └- ✖ fail: Fleet Endpoints EPM Endpoints EPM - list "after all" hook in "EPM - list"
[00:00:14]                   │      ResponseError: resource_already_exists_exception
[00:00:14]                   │       at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
[00:00:14]                   │       at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
[00:00:14]                   │       at endReadableNT (internal/streams/readable.js:1327:12)
[00:00:14]                   │       at processTicksAndRejections (internal/process/task_queues.js:80:21)
[00:00:14]                   │ 
[00:00:14]                   │ 

Stack Trace

ResponseError: resource_already_exists_exception
    at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
    at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  meta: {
    body: { error: [Object], status: 400 },
    statusCode: 400,
    headers: {
      'content-type': 'application/json;charset=utf-8',
      'content-length': '405'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}

Kibana Pipeline / general / X-Pack EPM API Integration Tests.x-pack/test/fleet_api_integration/apis/epm/list·ts.Fleet Endpoints EPM Endpoints EPM - list "before all" hook in "EPM - list"

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:00:00]         └-: Fleet Endpoints
[00:00:00]           └-> "before all" hook in "Fleet Endpoints"
[00:00:00]           └-: EPM Endpoints
[00:00:00]             └-> "before all" hook in "EPM Endpoints"
[00:00:14]             └-: EPM - list
[00:00:14]               └-> "before all" hook in "EPM - list"
[00:00:14]               └-> "before all" hook in "EPM - list"
[00:00:14]                 │ info [fleet/empty_fleet_server] Loading "mappings.json"
[00:00:14]                 └- ✖ fail: Fleet Endpoints EPM Endpoints EPM - list "before all" hook in "EPM - list"
[00:00:14]                 │      ResponseError: resource_already_exists_exception
[00:00:14]                 │       at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
[00:00:14]                 │       at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
[00:00:14]                 │       at endReadableNT (internal/streams/readable.js:1327:12)
[00:00:14]                 │       at processTicksAndRejections (internal/process/task_queues.js:80:21)
[00:00:14]                 │ 
[00:00:14]                 │ 

Stack Trace

ResponseError: resource_already_exists_exception
    at onBody (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:337:23)
    at IncomingMessage.onEnd (/dev/shm/workspace/parallel/2/kibana/node_modules/@elastic/elasticsearch/lib/Transport.js:264:11)
    at endReadableNT (internal/streams/readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  meta: {
    body: { error: [Object], status: 400 },
    statusCode: 400,
    headers: {
      'content-type': 'application/json;charset=utf-8',
      'content-length': '405'
    },
    meta: {
      context: null,
      request: [Object],
      name: 'elasticsearch-js',
      connection: [Object],
      attempts: 0,
      aborted: false
    }
  }
}

and 2 more failures, only showing the first 3.

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
remoteClusters 131 138 +7

Async chunks

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

id before after diff
remoteClusters 160.0KB 165.6KB +5.6KB

Page load bundle

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

id before after diff
remoteClusters 14.1KB 14.2KB +143.0B

History

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:CCR and Remote Clusters NeededFor:Cloud release_note:enhancement Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants