Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LaikaN57 committed Apr 18, 2024
1 parent 53ea6db commit 03d6102
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions charts/prometheus-alerts/templates/containers-prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ metadata:
{{- include "nd-common.labels" . | nindent 4 }}
spec:
groups:
{{- with .Values.containerRules.pods -}}
{{- with .Values.containerRules.pods }}
{{- if .enabled }}

- name: {{ $release.Name }}.{{ $release.Namespace }}.containerRules
rules:
{{- with .PodContainerTerminated -}}
{{- with .PodContainerTerminated }}
- alert: PodContainerTerminated
annotations:
summary: {{`Pod {{$labels.pod}} in namespace {{$labels.namespace}} in error status`}}
Expand All @@ -52,7 +52,7 @@ spec:
{{- end }}
{{ end -}}

{{- with .PodContainerOOMKilled -}}
{{- with .PodContainerOOMKilled }}
- alert: PodContainerOOMKilled
annotations:
summary: {{`Pod {{$labels.pod}} in namespace {{$labels.namespace}} in error status`}}
Expand All @@ -79,7 +79,7 @@ spec:
{{- end }}
{{ end -}}

{{- with .ContainerWaiting -}}
{{- with .ContainerWaiting }}
- alert: ContainerWaiting
annotations:
summary: Pod container waiting longer than {{ .for }}
Expand Down Expand Up @@ -139,10 +139,10 @@ spec:
#
- name: {{ .Release.Name }}.{{ .Release.Namespace }}.kubernetesAppsRules
rules:
{{- with .Values.containerRules.pods -}}
{{- with .Values.containerRules.pods }}
{{- if .enabled }}

{{- with .PodCrashLoopBackOff -}}
{{- with .PodCrashLoopBackOff }}
- alert: PodCrashLoopBackOff
annotations:
summary: {{`Container inside pod {{ $labels.pod }} is crash looping`}}
Expand All @@ -168,7 +168,7 @@ spec:
{{- end }}
{{- end }}

{{- with .PodNotReady -}}
{{- with .PodNotReady }}
- alert: PodNotReady
annotations:
summary: Pod has been in a non-ready state for more than {{ .for }}
Expand Down Expand Up @@ -205,10 +205,10 @@ spec:
{{- end }}
{{- end }}

{{- with .Values.containerRules.deployments -}}
{{- with .Values.containerRules.deployments }}
{{- if .enabled }}

{{- with .KubeDeploymentGenerationMismatch -}}
{{- with .KubeDeploymentGenerationMismatch }}
- alert: KubeDeploymentGenerationMismatch
annotations:
summary: Deployment generation mismatch due to possible roll-back
Expand All @@ -233,10 +233,10 @@ spec:
{{- end }}
{{- end }}

{{- with .Values.containerRules.statefulsets -}}
{{- with .Values.containerRules.statefulsets }}
{{- if .enabled }}

{{- with .KubeStatefulSetReplicasMismatch -}}
{{- with .KubeStatefulSetReplicasMismatch }}
- alert: KubeStatefulSetReplicasMismatch
annotations:
summary: StatefulSet has not matched the expected number of replicas.
Expand All @@ -263,7 +263,7 @@ spec:
{{- end }}
{{- end }}

{{- with .KubeStatefulSetGenerationMismatch -}}
{{- with .KubeStatefulSetGenerationMismatch }}
- alert: KubeStatefulSetGenerationMismatch
annotations:
summary: StatefulSet generation mismatch due to possible roll-back
Expand All @@ -285,7 +285,7 @@ spec:
{{- end }}
{{- end }}

{{- with .KubeStatefulSetUpdateNotRolledOut -}}
{{- with .KubeStatefulSetUpdateNotRolledOut }}
- alert: KubeStatefulSetUpdateNotRolledOut
annotations:
summary: StatefulSet update has not been rolled out.
Expand Down Expand Up @@ -322,10 +322,10 @@ spec:
{{- end }}
{{- end }}

{{- with .Values.containerRules.daemonsets -}}
{{- with .Values.containerRules.daemonsets }}
{{- if .enabled }}

{{- with .KubeDaemonSetRolloutStuck -}}
{{- with .KubeDaemonSetRolloutStuck }}
- alert: KubeDaemonSetRolloutStuck
annotations:
summary: DaemonSet rollout is stuck.
Expand Down Expand Up @@ -366,7 +366,7 @@ spec:
{{- end }}
{{- end }}

{{- with .KubeDaemonSetNotScheduled -}}
{{- with .KubeDaemonSetNotScheduled }}
- alert: KubeDaemonSetNotScheduled
annotations:
summary: DaemonSet pods are not scheduled.
Expand All @@ -387,7 +387,7 @@ spec:
{{- end }}
{{- end }}

{{- with .KubeDaemonSetMisScheduled -}}
{{- with .KubeDaemonSetMisScheduled }}
- alert: KubeDaemonSetMisScheduled
annotations:
summary: DaemonSet pods are misscheduled.
Expand All @@ -408,10 +408,10 @@ spec:
{{- end }}
{{- end }}

{{- with .Values.containerRules.jobs -}}
{{- with .Values.containerRules.jobs }}
{{- if .enabled }}

{{- with .KubeJobCompletion -}}
{{- with .KubeJobCompletion }}
- alert: KubeJobCompletion
annotations:
summary: Job did not complete in time
Expand All @@ -432,7 +432,7 @@ spec:
{{- end }}
{{- end }}

{{- with .KubeJobFailed -}}
{{- with .KubeJobFailed }}
- alert: KubeJobFailed
annotations:
summary: Job failed to complete.
Expand All @@ -453,10 +453,10 @@ spec:
{{- end }}
{{- end }}

{{- with .Values.containerRules.hpas -}}
{{- with .Values.containerRules.hpas }}
{{- if .enabled }}

{{- with .KubeHpaReplicasMismatch -}}
{{- with .KubeHpaReplicasMismatch }}
- alert: KubeHpaReplicasMismatch
annotations:
summary: HPA has not matched descired number of replicas.
Expand Down Expand Up @@ -499,7 +499,7 @@ spec:
{{- end }}
{{- end }}

{{- with .KubeHpaMaxedOut -}}
{{- with .KubeHpaMaxedOut }}
- alert: KubeHpaMaxedOut
annotations:
summary: HPA is running at max replicas
Expand Down

0 comments on commit 03d6102

Please sign in to comment.