Alerting¶
Prometheus (kube-prometheus-stack) evaluates the alert rules and Alertmanager sends them to Pushover. Two other detections, Flux reconciliation alerts and the Yanked Images workflow, don't use Prometheus rules; see Outside Prometheus.
Routing¶
The routing is defined in the
AlertmanagerConfig
(UI at alertmanager.bykaj.app):
- Every alert goes to Pushover, critical and warning alike. Firing alerts are sent with priority 1, resolved ones with priority 0.
WatchdogandInfoInhibitorgo to thenullreceiver.- A critical alert inhibits the warning alert with the same
alertnameandnamespace. - Alerts are grouped by
alertname,clusterandjob(wait 1m, interval 10m) and repeat every 24h while firing.
The message is the alert's description, or its summary if there is none,
followed by its labels except alertname and prometheus. A firing
notification lists only the group's firing alerts, a resolved one only the
resolved alerts. Pushover cuts messages off at 1024 characters, so put the most
important part (what and where) at the start of description, then what to do.
Rule sources¶
| Source | Alerts | Where |
|---|---|---|
| crd-schema-publisher | 2 | Chart rules |
| Custom rules | 29 | Below |
| kopiur | 13 | Chart prometheusRule in kopiur (backup failures, stale backups, repository health) |
| kube-prometheus-stack defaults | ~150 | Upstream kubernetes-mixin and node-exporter rules (defaultRules left at chart defaults) |
| Rook Ceph | 88 | createPrometheusRules in the cluster HelmRelease; CephNodeInconsistentMTU is disabled |
Upstream rule sets change with chart upgrades. To see what is loaded, run
kubectl get prometheusrules -A or open the Prometheus Alerts page.
Custom rules¶
Rules for one app live in that app's prometheusrule.yaml (or its chart's
prometheusRule values). Rules that aren't tied to an app go in
additionalPrometheusRulesMap in the
kube-prometheus-stack HelmRelease.
Cluster-wide (additionalPrometheusRulesMap)¶
| Alert | Severity | Fires when |
|---|---|---|
CiliumEgressPolicyDenied |
critical | An egress policy dropped a packet from a workload in the last 10 minutes; names the workload and destination. Drops from an explicit egressDeny (POLICY_DENY: Karakeep Chrome's multicast, Plex's multicast and broadcast) deliberately don't alert; see Cilium |
DockerhubRateLimitRisk |
critical | More than 100 running containers use docker.io images |
NvmeTemperatureCritical |
critical | An NVMe drive is at or above its warning threshold for 1 minute |
NvmeTemperatureHigh |
warning | An NVMe drive is within 2 °C of its warning threshold for 5 minutes |
OomKilled |
critical | A container restarted because of an OOM kill in the last 10 minutes |
PodSecurityBaselineViolation |
warning | A pod create or update in the last 10 minutes violated the Pod Security baseline of a namespace that audits it; find it with just k8s pss-violations (see Pod Security) |
ZfsUnexpectedPoolState |
critical | A NAS ZFS pool is not online |
Per app¶
| App | Alert | Severity | Fires when |
|---|---|---|---|
| autobrr | AutobrrNetworkUnmonitored |
critical | An enabled IRC channel is not monitored, for 1 hour |
| blackbox-exporter | BlackboxProbeFailed |
critical | A blackbox probe fails for 15 minutes |
| cert-manager | CertManagerAbsent |
critical | cert-manager is missing from Prometheus for 5 minutes |
| cert-manager | CertManagerCertExpirySoon |
critical | A certificate expires within 21 days |
| cert-manager | CertManagerCertNotReady |
critical | A certificate is not ready for 5 minutes |
| cert-manager | CertManagerHittingRateLimits |
critical | Let's Encrypt answers with HTTP 429 |
| cloudnative-pg | BackendsWaiting |
warning | More than 300 backends are waiting on locks held by other queries |
| cloudnative-pg | DatabaseDeadlockConflicts |
warning | A database has had more than 10 deadlocks since its statistics were last reset |
| cloudnative-pg | LastFailedArchiveTime |
warning | WAL archiving failed after the last successful archive |
| cloudnative-pg | LongRunningTransaction |
warning | A PostgreSQL transaction runs longer than 5 minutes |
| cloudnative-pg | PGDatabase |
warning | A database's transaction ID age exceeds 300 million (wraparound risk) |
| cloudnative-pg | PGReplication |
warning | A standby lags more than 5 minutes behind the primary |
| cloudnative-pg | ReplicaFailingReplication |
warning | A replica is in recovery but its WAL receiver is down |
| external-dns | ExternalDNSStale |
critical | ExternalDNS has not synced for 90 seconds, for 15 minutes |
| flux-instance | FluxInstanceAbsent |
critical | The Flux instance metric is missing for 5 minutes |
| flux-instance | FluxInstanceNotReady |
critical | The Flux instance is not ready for 5 minutes |
| gatus | GatusEndpointDown |
critical | An external or infrastructure endpoint in Gatus fails for 5 minutes |
| gatus | GatusEndpointExposed |
critical | An internal-only hostname has a public DNS record; see Gatus |
| nut-exporter | NutExporterAbsent |
critical | The NUT exporter is down for 5 minutes |
| nut-exporter | UpsBatteryReplace |
warning | The UPS reports that its battery needs replacing |
| nut-exporter | UpsLowBattery |
warning | The UPS battery charge is below 50% |
| nut-exporter | UpsLowRuntime |
critical | The UPS is on battery with less than 10 minutes of runtime left |
| nut-exporter | UpsOnBattery |
warning | The UPS runs on battery |
Coder (development/coder, 14 rules under app/rules/) is disabled, so its
rules are not loaded.
Silences¶
Permanent silences are Silence resources managed by the
silence-operator,
so they live in Git like everything else:
| Silence | Mutes |
|---|---|
ceph-node-local-diskspace-warning |
CephNodeDiskspaceWarning for /dev/nvme* devices |
ceph-node-nfsmount-diskspace-warning |
CephNodeDiskspaceWarning for the /etc/nfsmount.conf mount |
cpu-throttling |
CPUThrottlingHigh (small CPUs throttle, mostly during bootstrap) |
hpa-maxed-out |
KubeHpaMaxedOut |
nas-memory-high-utilization |
NodeMemoryHighUtilization on the NAS (nas.internal:9100) |
Use the Alertmanager UI for temporary silences, such as during maintenance.
Adding a rule¶
- Put it in the app's
prometheusrule.yamlif it is about one app, or inadditionalPrometheusRulesMapif it isn't. - Use
severity: criticalfor anything that needs action andwarningfor anything that can wait. A critical alert inhibits a warning with the same name in the same namespace. - Write a
descriptionthat says what to do; it is the Pushover message. - Check the expression against live data in Prometheus first, including a period when it should have fired.
- Add it to the tables above.
Outside Prometheus¶
- Flux: the
alertscomponent sends Kustomization and HelmRelease reconciliation failures to Alertmanager and posts commit statuses to GitHub. - Yanked images: a GitHub workflow opens a
type/securityissue when a pinned image disappears from its registry; see Yanked images. - Gatus: endpoint checks feed the
GatusEndpoint*rules above.