Skip to content

Commit

Permalink
Add alert to monitor Trivy pod restarts
Browse files Browse the repository at this point in the history
  • Loading branch information
fhielpos committed Nov 22, 2024
1 parent 428041b commit 349dbd4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `cloud-provider-controller.rules` to monitor the cloud-provider-controller components across providers.
- Add alerts to monitor the `HelmReleases` for `cilium` and `coredns`.
- Add alert to monitor the `HelmRelease` for the `vertical-pod-autoscaler-crd` app.
- Add alert to monitor `Trivy` pod restarts.

### Fixed

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
creationTimestamp: null
labels:
{{- include "labels.common" . | nindent 4 }}
name: kyverno.rules
namespace: {{ .Values.namespace }}
spec:
groups:
- name: trivy
rules:
- alert: TrivyComponentRestartingTooOften
annotations:
description: 'Trivy pod {{ $labels.namespace }}/{{ $labels.pod }} is restarting too often'
opsrecipe: trivy-pod-failing
expr: increase(kube_pod_container_status_restarts_total{cluster_type="workload_cluster", pod=~"trivy-.*"}[1h]) > 5
for: 15m
labels:
area: platform
cancel_if_cluster_status_creating: "true"
cancel_if_cluster_status_deleting: "true"
cancel_if_cluster_status_updating: "true"
cancel_if_outside_working_hours: {{ include "workingHoursOnly" . }}
severity: notify
team: shield
topic: trivy

0 comments on commit 349dbd4

Please sign in to comment.