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

Added S3 SSE support to alertmanager storage #3906

Merged

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented Mar 4, 2021

What this PR does:
After preliminary refactoring PRs, we can finally add S3 SSE support to alertmanager with per-tenant key support.

Due to the special nature of the objects structure used by AlertStore (the user ID is not a prefix but the object, so the alertmanager config for user-1 is stored in the object alerts/user-1) I had to some refactoring in UserBucketClient and PrefixedBucketClient.

I've manually tested it with S3 + KMS and looks working fine.

Which issue(s) this PR fixes:
N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

I think we should step back, and split split the two functions of existing user bucket (prefixing, and injecting SSE) to separate wrappers, and only use SSE-injection here.

Prefixed bucket client should not require any change in this PR.
New sse-injecting bucket client would only inject SSE based on configured user.
UserBucketClient would combine the two together. It would be used elsewhere, while Alertmanager would only use "sse-injecting" client. WDYT?

pkg/alertmanager/alertstore/bucketclient/bucket_client.go Outdated Show resolved Hide resolved
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci force-pushed the add-s3-sse-support-to-alertmanager branch from 6b53af5 to 9017fe9 Compare March 5, 2021 10:05
@pull-request-size pull-request-size bot added size/M and removed size/L labels Mar 5, 2021
@pracucci pracucci requested a review from pstibrany March 5, 2021 10:06
@pracucci
Copy link
Contributor Author

pracucci commented Mar 5, 2021

I think we should step back, and split split the two functions of existing user bucket (prefixing, and injecting SSE) to separate wrappers, and only use SSE-injection here.

@pstibrany Good idea. Done.

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Good job, thank you!

@pracucci pracucci merged commit ee33b36 into cortexproject:master Mar 5, 2021
@pracucci pracucci deleted the add-s3-sse-support-to-alertmanager branch March 5, 2021 16:22
roystchiang pushed a commit to roystchiang/cortex that referenced this pull request Apr 6, 2022
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants