Skip to content

Add follow-up silence CRD implementation proposal - #7798

Closed
danielmellado wants to merge 1 commit into
prometheus-operator:mainfrom
danielmellado:follow_up_silence_crd
Closed

danielmellado wants to merge 1 commit into
prometheus-operator:mainfrom
danielmellado:follow_up_silence_crd

Conversation

@danielmellado

@danielmellado danielmellado commented Aug 11, 2025 •

Copy link
Copy Markdown
Contributor

description

this pr adds a new, follow-up proposal for the silence crd implementation original one proposed by mcbenjemaa.

type of change

  • 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.)

@danielmellado
danielmellado requested a review from a team as a code owner August 11, 2025 09:52
@danielmellado
danielmellado force-pushed the follow_up_silence_crd branch from a7ba771 to a25b4b8 Compare August 11, 2025 10:06
@slashpai

Copy link
Copy Markdown
Contributor

Lets add @mcbenjemaa as co-author signature should be in #5485

@danielmellado
danielmellado force-pushed the follow_up_silence_crd branch from a25b4b8 to bdbd146 Compare August 11, 2025 11:48
danielmellado added a commit to danielmellado/prometheus-operator that referenced this pull request Aug 13, 2025
This commit implements the first implementation of the Silence CRD
proposed in [1]. It follows existing prometheus-operator patternsfrom
other CRDs and proposes the new api to v1alpha1.

[1] prometheus-operator#7798

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
@danielmellado danielmellado mentioned this pull request Aug 13, 2025
1 of 5 tasks
danielmellado added a commit to danielmellado/prometheus-operator that referenced this pull request Aug 13, 2025
This commit implements the first implementation of the Silence CRD
proposed in [1]. It follows existing prometheus-operator patternsfrom
other CRDs and proposes the new api to v1alpha1.

[1] prometheus-operator#7798

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>

@simonpasquier simonpasquier left a comment

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.

A couple more questions on top of my head:

  • How does the operator know when a silences should be created, updated or deleted? How will it match a silence resource to the silences retrieved from the API?
  • How do we ensure that a deleted Silence resource is effectively deleted from the Alertmanager API? Finalizers maybe?
  • When Alertmanager runs in cluster, should the operator ensure that the silence exists on all instances? E.g. what happens if the replication between Alertmanagers is broken/degraded?
  • We would need more details on the communication between the operator and Alertmanager API. Especially how do we provide API credentials to the operator? What are the supported authentication mechanisms?
  • How does it integrate with the namespace-based tenancy model? E.g. if user creates a silence in namespace foo, should the operator inject a namespace=foo matcher into the silence definition?

@danielmellado
danielmellado force-pushed the follow_up_silence_crd branch from bdbd146 to b1b1a7e Compare August 19, 2025 09:51
@danielmellado

Copy link
Copy Markdown
Contributor Author

I've also included some of the feedback and comments in #7806. I'll hold into generating the CRD and the API itself until we agree on a format, tho :D

@danielmellado
danielmellado force-pushed the follow_up_silence_crd branch from b1b1a7e to e2be541 Compare August 19, 2025 10:57

## Non-Goals

* Automatic cleanup of expired Silence CRs (users manage lifecycle)

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.

It triggers another point. Alertmanager will delete expired silences after some retention period (default: 120h). The option is available at .spec.retention. It's something that the controller might use to know if the silence has reached the retention limit.


* Automatic cleanup of expired Silence CRs (users manage lifecycle)
* Cross-cluster silence management (out of scope)
* Advanced templating features (deferred to future iterations)

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.

Not sure about this one. What does it cover exactly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I cherry picked this from the original but I have elaborated this a bit more, I'll upload a new version shortly ;)

@simonpasquier

Copy link
Copy Markdown
Contributor

This is looking great!

Posting again 2 questions from my initial review.

  • We would need more details on the communication between the operator and Alertmanager API. Especially how do we provide API credentials to the operator? What are the supported authentication mechanisms?

It kinda relates to #5836 and #7004. Right now the operator doesn't support Prometheus/Alertmanager configured with authentication (basic auth or token).

We need also to support a setup where the Alertmanager API is exposed via a reverse proxy (kube-rbac-proxy for instance).

  • How does it integrate with the namespace-based tenancy model? E.g. if user creates a silence in namespace foo, should the operator inject a namespace=foo matcher into the silence definition?

This would need to be documented too.

@danielmellado
danielmellado force-pushed the follow_up_silence_crd branch from e2be541 to 5b3026c Compare August 21, 2025 09:29
@simonpasquier

Copy link
Copy Markdown
Contributor

I'll hold into generating the CRD and the API itself until we agree on a format, tho :D

We can continue the discussion in the API PR in parallel since it's easier to comment against the actual code.

@danielmellado

Copy link
Copy Markdown
Contributor Author

I'll hold into generating the CRD and the API itself until we agree on a format, tho :D

We can continue the discussion in the API PR in parallel since it's easier to comment against the actual code.

let me regenerate it then XD

danielmellado added a commit to danielmellado/prometheus-operator that referenced this pull request Sep 25, 2025
This commit implements the first implementation of the Silence CRD
proposed in [1]. It follows existing prometheus-operator patternsfrom
other CRDs and proposes the new api to v1alpha1.

[1] prometheus-operator#7798

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Signed-off-by: Daniel Mellado <[email protected]>
danielmellado added a commit to danielmellado/prometheus-operator that referenced this pull request Sep 25, 2025
This commit implements the first implementation of the Silence CRD
proposed in [1]. It follows existing prometheus-operator patternsfrom
other CRDs and proposes the new api to v1alpha1.

[1] prometheus-operator#7798

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
danielmellado added a commit to danielmellado/prometheus-operator that referenced this pull request Sep 25, 2025
This commit implements the first implementation of the Silence CRD
proposed in [1]. It follows existing prometheus-operator patternsfrom
other CRDs and proposes the new api to v1alpha1.

[1] prometheus-operator#7798

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Signed-off-by: Daniel Mellado <[email protected]>
danielmellado added a commit to danielmellado/prometheus-operator that referenced this pull request Sep 25, 2025
This commit implements the first implementation of the Silence CRD
proposed in [1]. It follows existing prometheus-operator patternsfrom
other CRDs and proposes the new api to v1alpha1.

[1] prometheus-operator#7798

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Signed-off-by: Daniel Mellado <[email protected]>
specification, reusing existing authentication fields where possible to maintain
consistency with Prometheus authentication patterns.

### Authentication and Reverse Proxy Support

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.

I'm still a bit unclear on how we should inject credentials into the Alertmanager CR. In particular we want to avoid duplication with related efforts such as #5836.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we just defer al this configurations to #5836 ? I modified how is this explained to directly do that and align.

@danielmellado
danielmellado force-pushed the follow_up_silence_crd branch 2 times, most recently from 69705c3 to 9b2c81e Compare September 30, 2025 09:35
This commit adds a a new follow-up proposal to cover implementation of
silences CRD.

Signed-off-by: Daniel Mellado <[email protected]>
Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Signed-off-by: Daniel Mellado <[email protected]>
@github-actions github-actions Bot removed the stale label Mar 16, 2026
@github-actions github-actions Bot added the stale label May 15, 2026
coffeegoesincodecomesout added a commit to coffeegoesincodecomesout/prometheus-operator that referenced this pull request Oct 9, 2026
…ation

Expand the expired-silence section with:

- The two-phase Alertmanager lifecycle: endsAt passes → expired state
  (still accessible); endsAt + spec.retention passes (default 120h) →
  purged (404). Addresses simonpasquier's comment from PR prometheus-operator#7798 about
  spec.retention and its role in silence lifecycle management.

- How to re-activate an expired Silence CR: update spec.endsAt or
  spec.duration to a future time; the next reconcile resumes normally.
  Addresses the re-activation question raised on the original proposal.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
coffeegoesincodecomesout added a commit to coffeegoesincodecomesout/prometheus-operator that referenced this pull request Oct 9, 2026
Proposes a Silence custom resource for prometheus-operator, so that
Alertmanager silences can be managed declaratively through the
Kubernetes API rather than only through the Alertmanager UI or REST API.

Supersedes the proposal in prometheus-operator#7798, and builds on the original in prometheus-operator#5485
and the API review in prometheus-operator#7806. The status subresource follows the accepted
configuration-resource convention, with the Alertmanager-assigned UUID
as its one addition: the silence API is not declarative, so the handle
it returns on creation is the only way to address a silence later, and
it cannot be re-derived.

Related: prometheus-operator#5452, prometheus-operator#2398, prometheus-operator#5836

Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Co-authored-by: Daniel Mellado <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Nigel Smith <[email protected]>
coffeegoesincodecomesout added a commit to coffeegoesincodecomesout/prometheus-operator that referenced this pull request Oct 9, 2026
Proposes a Silence custom resource for prometheus-operator, so that
Alertmanager silences can be managed declaratively through the
Kubernetes API rather than only through the Alertmanager UI or REST API.

Supersedes the proposal in prometheus-operator#7798, and builds on the original in prometheus-operator#5485
and the API review in prometheus-operator#7806. The status subresource follows the accepted
configuration-resource convention, with the Alertmanager-assigned UUID
as its one addition: the silence API is not declarative, so the handle
it returns on creation is the only way to address a silence later, and
it cannot be re-derived.

Adds amtool and the two author handles to the spell-check dictionary,
following the existing convention for contributor names.

Related: prometheus-operator#5452, prometheus-operator#2398, prometheus-operator#5836

Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Co-authored-by: Daniel Mellado <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Nigel Smith <[email protected]>
coffeegoesincodecomesout added a commit to coffeegoesincodecomesout/prometheus-operator that referenced this pull request Oct 9, 2026
Proposes a Silence custom resource for prometheus-operator, so that
Alertmanager silences can be managed declaratively through the
Kubernetes API rather than only through the Alertmanager UI or REST API.

Supersedes the proposal in prometheus-operator#7798, and builds on the original in prometheus-operator#5485
and the API review in prometheus-operator#7806. The status subresource follows the accepted
configuration-resource convention, with the Alertmanager-assigned UUID
as its one addition: the silence API is not declarative, so the handle
it returns on creation is the only way to address a silence later, and
it cannot be re-derived.

Adds amtool and the two author handles to the spell-check dictionary,
following the existing convention for contributor names.

Related: prometheus-operator#5452, prometheus-operator#2398, prometheus-operator#5836

Co-authored-by: Mohamed Chiheb Ben Jemaa <[email protected]>
Co-authored-by: Daniel Mellado <[email protected]>
Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Nigel Smith <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

This pull request is being closed because it had no activity in the last 180 days. This is not a signal from the maintainers that the PR has no value. We appreciate the time and effort that you put into this work. If you're willing to re-open it, the maintainers will do their best to review it.

@github-actions github-actions Bot closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants