-
Notifications
You must be signed in to change notification settings - Fork 224
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
[Proposal] Add snapshot capability to the OpenSearch cluster. #278
Comments
If I may suggest it might be worth making the proposed snapshot config accept a list. This way it would be possible to configure more than one snapshot policy, i.e., for snapshotting to different repositories (e.g., S3 + GCS) or snapshotting specific index patterns. Also ideally the 4 repository plugins listed in the official docs should be supported (which should be easy enough given that only the repository settings would be different)
|
My thoughts on this:
|
Hey @max-frank thanks, as @swoehrl-mw mentioned we can start with s3, azure and gcs repositories, but what I propose is the method to use of |
@prudhvigodithi : I suggest to change the config yaml structure a bit: snapshot:
repository:
name: <CUSTOM_NAME>
type: s3
settings:
##User required settings to connect to s3
bucket: my-bucket
another_setting: setting-value
region: us-east-1
base_path: os-snapshot That way if we later decide to add options to configure snapshot schedules and the like we can add it as a key like |
Something to also consider in terms of backups is the new remote backend storage feature released with 2.3. While the feature is still experimental for now it would probably a good idea to consider it during design of the configuration here since it also is based on the repositories. Just to make sure that whatever format is chosen here can also support the eventual addition of remote backend storage. |
One additional thing this needs for s3-compatible blob stores is setting the endpoint, etc. This has to be done in the https://opensearch.org/docs/latest/opensearch/snapshots/snapshot-restore#register-repository |
#### Related issue: #278 #### Key Points: - Added logic to configure the snapshot repo settings for the OpenSearch cluster. - Multiple snapshot repo's can be configured at the same time. - Added logic to run a k8s job to call OpenSearch API to add the user configured snapshot repo settings. - The setup expects the following prerequisites are met: 1) The related plugins (ex repository-s3) are installed using [add plugins](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/userguide/main.md#add-plugins) method. 2) The required roles/permissions for the backend cloud are pre-created. 3) Since add a snapshot repo configuration should be done after all the cluster nodes are up and ready, ensure the cluster is fully healthy before adding the snapshot settings. - Once the Snapshot setting is added and applied, user can create the right policies from OpenSearch Dashboard (or via snapshot management API) to run the snapshots to the configured repos (which is done by the operator) #### Sample configuration: NOTE: Add the `snapshot` setting and apply the config file, only after the cluster is fully functional. ``` apiVersion: opensearch.opster.io/v1 kind: OpenSearchCluster metadata: name: my-first-cluster spec: security: tls: http: generate: true transport: generate: true perNode: true general: snapshotRepositories: - name: my_s3_repository_3 type: s3 settings: bucket: opensearch-s3-snapshot region: us-east-1 base_path: os-snapshot_3 - name: my_s3_repository_4 type: s3 settings: bucket: opensearch-s3-snapshot region: us-east-1 base_path: os-snapshot_1 httpPort: 9400 serviceName: my-first-cluster version: 2.6.0 pluginsList: ["repository-s3"] drainDataNodes: true dashboards: version: 2.6.0 enable: true replicas: 1 nodePools: - component: masters replicas: 3 persistence: emptyDir: {} roles: - "data" - "cluster_manager" ```
Added on last release (v2.3.0) as BETA feature. Closing the issue, Please open new one with implementations that left for GA |
Background:
As part of the next phase roadmap snapshot capability will be added to the operator, to create the OpenSearch cluster snapshot via the base configured yaml.
Proposal:
Design
With the install custom plugins capability , its possible to now install
repository-s3
(pluginsList: ["repository-s3"]
), using this plugin the initial start is to add snapshot capability to the operator to store the snapshots to the s3 bucket.Once the snasphot of type s3 is added to the
yaml
and with user configured settings, an API call will be invoked to the cluster.Example
PUT "https://localhost:9200/_snapshot/my_s3_repository_1?pretty" -H 'Content-Type: application/json' -d' { "type": "s3", "settings": { "bucket": "opensearch-s3-snapshot", "region": "us-east-1", "base_path": "os-snapshot" } } '
Assumptions:
Sample AWS IAM policy to be added to the node role
Snapshot Management and Shared responsibilities
PUT _snapshot/my_s3_repository_1/%3Csnapshot-%7Bnow%2Fd%7D%3E"
Future Enhancement
The text was updated successfully, but these errors were encountered: