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

[Index Management] Disable certain actions for serverless #161528

Conversation

sabarasaba
Copy link
Member

@sabarasaba sabarasaba commented Jul 10, 2023

Fixes #157945

Summary

In serverless, certain index actions will be blocked by Elasticsearch. This PR creates a new config that allows us to configure their visibility to the user and disables it for serverless. The disabled actions are:

  • /{index}/_cache/clear
  • /{index}/_flush
  • /{index}/_forcemerge
  • /{index}/_freeze
  • /{index}/_unfreeze
  • /{index}/_stats
  • /{index}/_close (internal access only)
  • /{index}/_open (internal access only)
  • /{index}/_refresh
How to test
  1. Start elasticsearch with yarn es snapshot --license=trial and serverless search solution with yarn serverless-es
  2. Navigate to Console and create a simple index PUT test/_doc/1 { message: "hello" }
  3. Navigate to the Index Management app (Navigation doesnt include a link to it yet but can can access it by url directly with /app/management/data/index_management/indices) and make sure that the actions are limited to whats allowed.
  4. Check in regular on-prem kibana that all the actions are available
Screenshots

// Serverless
Screenshot 2023-07-10 at 10 36 53
// On-prem
Screenshot 2023-07-10 at 10 32 55

@sabarasaba sabarasaba added Feature:Index Management Index and index templates UI Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Project:Serverless Work as part of the Serverless project for its initial release v8.10.0 labels Jul 10, 2023
@sabarasaba sabarasaba self-assigned this Jul 10, 2023
@sabarasaba sabarasaba marked this pull request as ready for review July 10, 2023 11:26
@sabarasaba sabarasaba requested review from a team as code owners July 10, 2023 11:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

Copy link
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.

LGTM for serverless config change

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Thanks for making these changes @sabarasaba! I tested locally and code changes overall look good to me. I only saw one place where the logic might need to be changed. Let me know what you think.

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comment! LGTM 👍

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
indexManagement 523.1KB 523.2KB +145.0B

Page load bundle

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

id before after diff
indexManagement 27.9KB 27.9KB +23.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 409 413 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 488 492 +4
total +6

History

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

cc @sabarasaba

Copy link
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.

Changes to test/plugin_functional/test_suites/core_plugins/rendering.ts LGTM

@sabarasaba sabarasaba merged commit 7c333cd into elastic:main Jul 13, 2023
20 checks passed
yuliacech added a commit that referenced this pull request Aug 10, 2023
## Summary
Follow up to #161528 

This PR leverages the [schema.contextRef('serverless')
check](https://www.elastic.co/guide/en/kibana/master/configuration-service.html#validating-your-configuration-based-on-context-references)
to prevent the config `enableIndexActions` from leaking to self-managed.

### Screenshots
Stateful (no changes), index actions enabled

<img width="916" alt="Screenshot 2023-08-09 at 12 15 31"
src="https://github.com/elastic/kibana/assets/6585477/527ce600-8758-44b4-bd41-c93723254646">

Serverless (no changes), index actions disabled

<img width="622" alt="Screenshot 2023-08-09 at 12 09 45"
src="https://github.com/elastic/kibana/assets/6585477/80190375-6cea-445d-8a75-3b354a447e9d">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Index Management Index and index templates UI Project:Serverless Work as part of the Serverless project for its initial release release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Index Management] Disable support for some index actions
6 participants