Skip to main content

NotificationSilence

The NotificationSilence CRD allows you to define periods when specific notifications should be silenced to prevent alert fatigue and manage maintenance windows.

Definition

apiVersion: mission-control.flanksource.com/v1
kind: NotificationSilence
metadata:
name: example-silence
spec:
# Time period for the silence
start: "2023-06-01T10:00:00Z"
end: "2023-06-01T14:00:00Z"

# Selector for events to silence
selector:
components:
- database-cluster
- api-service
labels:
environment: production

# Reason for the silence
reason: "Scheduled database maintenance"

Schema

The NotificationSilence resource supports the following fields:

FieldDescription
spec.startStart time of the silence period (ISO 8601 format)
spec.endEnd time of the silence period (ISO 8601 format)
spec.durationAlternative to end time - duration from start time
spec.selectorSelector for matching events to silence
spec.selector.severitySeverity levels to silence
spec.selector.labelsLabels to match on events
spec.selector.componentsComponents to silence
spec.selector.expressionCEL expression for complex matching
spec.reasonReason for the silence period
spec.creatorPerson or system that created the silence
spec.commentAdditional comments about the silence
spec.jiraAssociated JIRA ticket information
spec.createdByUser who created the silence

Status

The NotificationSilence controller updates the resource with status information:

Status FieldDescription
status.activeWhether the silence is currently active
status.createdTimestamp when the silence was created
status.updatedTimestamp when the silence was last updated
status.eventsCount of silenced events

Examples

Maintenance Window

apiVersion: mission-control.flanksource.com/v1
kind: NotificationSilence
metadata:
name: database-maintenance
spec:
start: "2023-06-01T10:00:00Z"
end: "2023-06-01T14:00:00Z"
selector:
components:
- database-cluster
- database-api
labels:
tier: database
reason: "Scheduled database upgrade"
creator: "Database Team"
comment: "Upgrading to PostgreSQL 15"
jira: "MAINT-1234"

Silence by Duration

apiVersion: mission-control.flanksource.com/v1
kind: NotificationSilence
metadata:
name: api-deployment
spec:
start: "2023-07-15T08:00:00Z"
duration: 2h
selector:
components:
- api-gateway
- auth-service
labels:
environment: production
reason: "API Gateway Deployment"
creator: "DevOps Team"

Weekend Maintenance Window

apiVersion: mission-control.flanksource.com/v1
kind: NotificationSilence
metadata:
name: weekend-maintenance
spec:
start: "2023-08-05T22:00:00Z"
end: "2023-08-06T06:00:00Z"
selector:
severity:
- low
- medium
expression: "!contains(labels.keys(), 'critical-path')"
reason: "Weekend system maintenance"
creator: "System Administrator"
comment: "Regular weekly maintenance window"

Complex Selector with Expression

apiVersion: mission-control.flanksource.com/v1
kind: NotificationSilence
metadata:
name: testing-environment
spec:
start: "2023-09-10T00:00:00Z"
end: "2023-09-12T00:00:00Z"
selector:
expression: |
labels.environment == 'testing' &&
(severity == 'low' || severity == 'medium')
reason: "Extended testing period"
creator: "QA Team"

See Also