I am deploying OpenSearch using the official Helm chart and want to add the repository-s3
plugin for snapshot storage in AWS S3. To achieve this, I have enabled the plugin in the Helm values file under the plugins
section as follows:
plugins:
enabled: true
installList:
- "repository-s3"
Additionally, I have configured my AWS credentials by setting the access key, secret key, and region as environment variables:
extraEnvs:
- name: AWS_ACCESS_KEY_ID
value: "<my_access_key>"
- name: AWS_SECRET_ACCESS_KEY
value: "<my_secret_key>"
- name: AWS_REGION
value: "<my_region>"
The credentials have the required permissions to perform snapshot operations in S3. However, after deploying OpenSearch, I encountered the following error when attempting to create an S3 snapshot repository:
{"error":{"root_cause":[{"type":"repository_exception","reason":"[s3-repo] Could not determine repository generation from root blobs"}],"type":"repository_exception","reason":"[s3-repo] Could not determine repository generation from root blobs","caused_by":{"type":"i_o_exception","reason":"Exception when listing blobs by prefix [index-]","caused_by":{"type":"sdk_client_exception","reason":"Failed to load credentials from IMDS.","caused_by":{"type":"sdk_client_exception","reason":"The requested metadata is not found at http://<ip>/latest/meta-data/iam/security-credentials/"}}}},"status":500}
Despite setting the AWS credentials explicitly, OpenSearch appears to be attempting to retrieve them from the Instance Metadata Service (IMDS) instead of using the provided environment variables. I have also verified that the repository-s3
plugin is installed inside the pod by running:
kubectl exec -it <opensearch-pod> -- bin/opensearch-plugin list
Even after this, the error remains. It seems OpenSearch is still failing to authenticate properly with S3. I would like to know if there is a specific configuration required to ensure OpenSearch correctly reads the AWS credentials from environment variables. Additionally, if any extra configurations need to be added to the values.yaml
file for repository-s3
to work correctly, please provide guidance on that.