Skip to content

feat: Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager/Thanos CRD#8494

Open
dongjiang1989 wants to merge 8 commits intoprometheus-operator:mainfrom
kubeservice-stack:update-sigv4
Open

feat: Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager/Thanos CRD#8494
dongjiang1989 wants to merge 8 commits intoprometheus-operator:mainfrom
kubeservice-stack:update-sigv4

Conversation

@dongjiang1989
Copy link
Copy Markdown
Member

@dongjiang1989 dongjiang1989 commented Apr 7, 2026

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

ref: https://github.com/prometheus/prometheus/pull/17916/changes
Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager CRD.

If you're contributing for the first-time, check our contribution guidelines.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager CRD.

Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989 dongjiang1989 requested a review from a team as a code owner April 7, 2026 10:25
Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989 dongjiang1989 changed the title feat: Add AWS external_id support in sigv4 configuration for Prometheus CRD feat: Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager CRD Apr 7, 2026
Signed-off-by: dongjiang <dongjiang1989@126.com>
@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 7, 2026
@dongjiang1989
Copy link
Copy Markdown
Member Author

cc @simonpasquier PTAL

Signed-off-by: dongjiang <dongjiang1989@126.com>
Copy link
Copy Markdown
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

we need also to update the Thanos controller

// Thanos does not support azureAD.workloadIdentity in any version
if rw.AzureAD != nil && rw.AzureAD.WorkloadIdentity != nil {
reset := resetFieldFn("none")
reset("azureAD.workloadIdentity", &rw.AzureAD.WorkloadIdentity)
}

Comment thread pkg/apis/monitoring/v1/prometheus_types.go
Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989
Copy link
Copy Markdown
Member Author

we need also to update the Thanos controller

// Thanos does not support azureAD.workloadIdentity in any version
if rw.AzureAD != nil && rw.AzureAD.WorkloadIdentity != nil {
reset := resetFieldFn("none")
reset("azureAD.workloadIdentity", &rw.AzureAD.WorkloadIdentity)
}

Add unittest case done.

@dongjiang1989
Copy link
Copy Markdown
Member Author

Thanks @simonpasquier
Please re-check it

Comment thread pkg/apis/monitoring/v1/prometheus_types.go
Comment thread pkg/thanos/operator_test.go Outdated
golden: "v0.24.0_remote_write_config.golden",
},
{
name: "sigv4 version",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AFAICT Thanos doesn't yet support the field so we need to drop before generating the config.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Remove it done.
Thanks @simonpasquier

Comment thread pkg/prometheus/promcfg_test.go
Comment thread pkg/alertmanager/amcfg.go
Comment thread pkg/apis/monitoring/v1/prometheus_types.go Outdated
Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989 dongjiang1989 changed the title feat: Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager CRD feat: Add AWS external_id support in sigv4 configuration for Prometheus/Alertmanager/Thanos CRD Apr 16, 2026
@dongjiang1989
Copy link
Copy Markdown
Member Author

Thanks @simonpasquier Updated.
Please re-check it

Comment thread pkg/alertmanager/amcfg.go
Comment thread pkg/apis/monitoring/v1/prometheus_types.go Outdated
Comment thread pkg/alertmanager/amcfg.go Outdated
Signed-off-by: dongjiang <dongjiang1989@126.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