Skip to content

Instantly share code, notes, and snippets.

@martinhaus
Created April 18, 2020 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinhaus/014baecac79127f74bdfd6294cae3fb4 to your computer and use it in GitHub Desktop.
Save martinhaus/014baecac79127f74bdfd6294cae3fb4 to your computer and use it in GitHub Desktop.
# The generic rule
- alert: K8SNodeCPUUtilization
expr: K8SNodeCPUUtilization > 90
for: 5m
labels:
severity: high
annotations:
identifier: '{{ $labels.kubernetes_cluster }}/{{ $labels.instance_name }}'
msg: Node CPU ultilization by containers has been over 90% for more than 5m.
reason: Node CPU ultilization by containers is high. Recalculate CPU request and limits.
value: '{{ printf "%.2f" $value }}%'
# The override rule
- alert: K8SNodeCPUUtilizationDev
override: ["K8SNodeCPUUtilization"]
enabled: true
expr: K8SNodeCPUUtilization{kubernetes_cluster="kube-dev"} > 90
for: 1h
labels:
severity: warning
annotations:
identifier: '{{ $labels.kubernetes_cluster }}/{{ $labels.instance_name }}'
msg: Node CPU ultilization by containers has been over 90% for more than 1h.
reason: Node CPU ultilization by containers is high. Recalculate CPU request and limits.
value: '{{ printf "%.2f" $value }}%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment