kube-state-metrics (NodePort 30808) und ServiceAccount prometheus-infra (nur nodes/metrics) im Cluster; Prometheus auf infra liest kubelet/cAdvisor per TLS gegen die k3s-CA. Ziele per file_sd aus kubectl get nodes, cAdvisor auf die nötigen Reihen begrenzt. Dashboard "k3s – Pods" (Vorgabe nex), Alerts K3s* nur mit notify. Playbook monitoring-k3s.yml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
abf4a75063
commit
4ac251715e
@@ -47,3 +47,33 @@ groups:
|
||||
for: 15m
|
||||
labels: {severity: warning}
|
||||
annotations: {summary: "{{ $labels.instance }} {{ $labels.mountpoint }} < 10 % frei"}
|
||||
|
||||
# k3s (Task 6.5): nur melden, der Healer greift nicht ein (config/healer-rules.yaml, Aktion notify)
|
||||
- name: knaster-k3s
|
||||
rules:
|
||||
- alert: K3sNodeNotReady
|
||||
expr: kube_node_status_condition{condition="Ready", status="true"} == 0
|
||||
for: 5m
|
||||
labels: {severity: high}
|
||||
annotations: {summary: "k3s-Knoten {{ $labels.node }} nicht bereit"}
|
||||
|
||||
- alert: K3sPodCrashLooping
|
||||
expr: max by (namespace, pod, container) (kube_pod_container_status_waiting_reason{reason="CrashLoopBackOff"}) == 1
|
||||
for: 10m
|
||||
labels: {severity: warning}
|
||||
annotations: {summary: "{{ $labels.namespace }}/{{ $labels.pod }} ({{ $labels.container }}) startet immer wieder neu"}
|
||||
|
||||
- alert: K3sDeploymentUnavailable
|
||||
expr: max by (namespace, deployment) (kube_deployment_spec_replicas) > max by (namespace, deployment) (kube_deployment_status_replicas_available)
|
||||
for: 15m
|
||||
labels: {severity: warning}
|
||||
annotations: {summary: "Deployment {{ $labels.namespace }}/{{ $labels.deployment }} hat zu wenige bereite Pods"}
|
||||
|
||||
- alert: K3sContainerMemoryNearLimit
|
||||
expr: >
|
||||
max by (namespace, pod, container) (container_memory_working_set_bytes{job="cadvisor"})
|
||||
/ on (namespace, pod, container)
|
||||
max by (namespace, pod, container) (kube_pod_container_resource_limits{resource="memory"}) > 0.9
|
||||
for: 10m
|
||||
labels: {severity: warning}
|
||||
annotations: {summary: "{{ $labels.namespace }}/{{ $labels.pod }} ({{ $labels.container }}) über 90 % des Speicherlimits"}
|
||||
|
||||
Reference in New Issue
Block a user