Skip to content

feat: recurring silence - #575

Open
zasdaym wants to merge 1 commit into
giantswarm:mainfrom
zasdaym:feature/recurring-silence
Open

feat: recurring silence#575
zasdaym wants to merge 1 commit into
giantswarm:mainfrom
zasdaym:feature/recurring-silence

Conversation

@zasdaym

@zasdaym zasdaym commented Jul 4, 2025

Copy link
Copy Markdown

Resolves #363.

Checklist

  • Update changelog in CHANGELOG.md.

@zasdaym
zasdaym requested a review from a team as a code owner July 4, 2025 06:18
@zasdaym
zasdaym force-pushed the feature/recurring-silence branch from d2d65fa to 97d7253 Compare July 7, 2025 06:53
@QuentinBisson

Copy link
Copy Markdown
Contributor

Hey @zasdaym thank you for your contribution, I will try to take a look at the approach before the end of the month

@zasdaym
zasdaym force-pushed the feature/recurring-silence branch from 0cc0cf4 to 639b5ca Compare July 19, 2025 06:45
Comment thread api/v1alpha2/recurringsilence_types.go Outdated
// Schedule is the cron expression for the recurring silence.
// It follows the format of https://github.com/aptible/supercronic.
// +kubebuilder:validation:Required
Schedule string `json:"schedule"`

@QuentinBisson QuentinBisson Jul 30, 2025

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 think it would make sense to do it the same way it is done with kubernetes jobs. Can you compare the 2 ways? Same for timezones

Comment thread api/v1alpha2/recurringsilence_types.go Outdated

// SilenceTemplate defines the template for the Silence object to be created.
// +kubebuilder:validation:Required
SilenceTemplate SilenceSpec `json:"silenceTemplate"`

@QuentinBisson QuentinBisson Jul 30, 2025

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 am not sure this works because silences were not thought of as templates. Where are you specifying the start and end date of the silence?

@QuentinBisson QuentinBisson Jul 30, 2025

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.

Okay I see what you did with createSilence but the end is still missing right? Can you check the cr example I posted at the end?

@QuentinBisson QuentinBisson Jul 30, 2025

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.

Also i think this PR makes sense (instead of the current annotation way) #580 and this would invalidate this. I would probably rebase your branch on the one I linked

Comment thread api/v1alpha2/recurringsilence_types.go Outdated
limitations under the License.
*/

package v1alpha2

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.

This should probably be a v1alpha1 but use the silence v1alpha2 spec

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Why? v1alpha1 is already deprecated right?

@QuentinBisson

Copy link
Copy Markdown
Contributor

@zasdaym what do you think about this CRD instead?

apiVersion: observability.giantswarm.io/v1alpha1
kind: RecurringSilence
metadata:
  name: nightly-silence
  namespace: foo
spec:
  schedule: "0 0 * * *"
  duration: "2h"
  matchers:
    - name: severity
      value: warning
      matchType: "="

@zasdaym
zasdaym force-pushed the feature/recurring-silence branch from 639b5ca to 15a77f5 Compare August 7, 2025 10:33
@zasdaym

zasdaym commented Aug 7, 2025

Copy link
Copy Markdown
Author

@zasdaym what do you think about this CRD instead?

apiVersion: observability.giantswarm.io/v1alpha1
kind: RecurringSilence
metadata:
  name: nightly-silence
  namespace: foo
spec:
  schedule: "0 0 * * *"
  duration: "2h"
  matchers:
    - name: severity
      value: warning
      matchType: "="

Seems OK, I've updated my PR to use this spec.

@zasdaym
zasdaym force-pushed the feature/recurring-silence branch from 15a77f5 to 408a9ac Compare August 10, 2025 03:53
@zasdaym
zasdaym requested a review from QuentinBisson August 13, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option for recurring silences

2 participants