-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[WIP] Operator and plugin read-only settings #86224
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grcevski
added
>enhancement
WIP
:Core/Infra/Core
Core issues without another label
Team:Core/Infra
Meta label for core/infra team
v8.3.0
labels
Apr 27, 2022
Pinging @elastic/es-core-infra (Team:Core/Infra) |
grcevski
pushed a commit
to grcevski/elasticsearch
that referenced
this pull request
May 19, 2022
Extract execute logic from the transport actions for cluster update settings and ILM put/delete to support future reuse for operator file based updates. Relates to elastic#86224
grcevski
added a commit
that referenced
this pull request
May 25, 2022
Extract execute logic from the transport actions for cluster update settings and ILM put/delete to support future reuse for operator file based updates. Relates to #86224
salvatore-campagna
pushed a commit
to salvatore-campagna/elasticsearch
that referenced
this pull request
May 26, 2022
Extract execute logic from the transport actions for cluster update settings and ILM put/delete to support future reuse for operator file based updates. Relates to elastic#86224
@elasticmachine run elasticsearch-ci/part-2 |
93 tasks
This was referenced Jun 16, 2022
Merged
This was referenced Jun 27, 2022
grcevski
added a commit
that referenced
this pull request
Jun 29, 2022
This commit only introduces the storage classes, unused for now. Relates to #86224
grcevski
added a commit
that referenced
this pull request
Jul 4, 2022
Merged
Closing this Draft PR, all of the changes are either in or in waiting on PR review. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:Core/Infra/Core
Core issues without another label
>feature
Team:Core/Infra
Meta label for core/infra team
v8.4.0
WIP
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduction
This PR introduces the concept of operator settings. The operator setting have the following properties:
Implementation details
We have multiple components introduced by this PR:
File Settings Service
Watches a directory under Elasticsearch
config
for changes to a file calledsettings.json
. This is a JSON file describing the settings that the operator wants to set that will be immutable through the REST API. Any changes to these settings will only be allowed through modifying the file. As configured by default we watch for a pathoperator/settings.json
under the config directory. The name of the directoryoperator
can be changed via settings.The File Settings Service will notice updates to the file and perform an update. The operator directory doesn't have to exist, the file setting service will notice when it's created. Recommended way to change operator file based settings is through modifying the settings.json file in a brand new location and then performing a symlink under the Elasticsearch config directory.
Operator Cluster State Controller
This is a reusable component that has number of
Operator Handler
components that know how to update parts of the Elasticsearch state. This component is only used by the File Settings Service at the moment, but the intent is for modules and plugins to be able to call it to save settings and entities in the cluster state that cannot be changed by the end user.Operator Metadata
This is an extension to the ClusterState Metadata object where we store various information about the operator updated state. This Operator Metadata object contains information about the version and the 'keys' that were set in the cluster state, through the operator interface. We use this information to coordinate updates and to ensure that the keys of the cluster state set by the operator are not overwritten by the REST API.
Example operator state to be set by file based settings
In the example above we can see the following details:
Metadata information
We show an example of how the version can be set along with the Elasticsearch Version for compatibility. The
version
metadata field is assumed to be of typelong
and it's encoded as a JSON String to avoid precision errors in certain JSON language implementations (e.g. JavaScript). For proper usage, each time the cluster state is updated we need to bump the version. The version bump has to be increasing in value, but not necessarily monotonically increasing, e.g. we can use a consistent epoch timestamp generator for versioning purposes.The
compatibility
field is used to enforce a minimum Elasticsearch version that can understand the file content. We can use this field to avoid trying to apply the cluster settings to an incompatible Elasticsearch version in mixed version clusters.State information
In this case we show an example of two separate operator state handlers:
cluster settings
andilm
.This cluster state information will be applied as one single cluster state update. Even though the two transport actions are separate when we use the REST API, with operator state updates we first validate everything up-front and then we use a joint cluster state update.
In the example above, the final
OperatorMetadata
will contain information about twoOperatorHandlers
, cluster_settings and ilm, which individually will contain thekeys
of the settings that are updated (indices.recovery.max_bytes_per_sec and my_timeseries_lifecycle respectively). If these two settings were set as an operator state, any REST API requests that want to modifyindices.recovery.max_bytes_per_sec
or mutate/delete themy_timeseries_lifecycle
policy, would be rejected.Scope of the PR
This PR doesn't handle yet updates to
role mappings
which are not stored in the cluster state. Given the PR is large as-is, the ability to set role mappings through in operator mode will be added as a follow-up PR.Documentation will also be done as separate PR.
This PR will be used to finalize the file based settings changes after the following sub PRs are finished:
TODO