Skip to content

Commit

Permalink
chore(charts/app): remove some bad alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
diranged committed Dec 15, 2023
1 parent ed34754 commit 39d7c57
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 134 deletions.
27 changes: 0 additions & 27 deletions charts/prometheus-alerts/templates/containers-prometheusrule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,33 +215,6 @@ spec:
{{- end }}
{{- end }}

{{ with .Values.containerRules.KubeDeploymentReplicasMismatch -}}
- alert: KubeDeploymentReplicasMismatch
annotations:
summary: Deployment has not matched the expected number of replicas.
runbook_url: {{ $values.defaults.runbookUrl }}#alert-name-kubedeploymentreplicasmismatch
description: >-
Deployment {{`{{`}} $labels.namespace {{`}}`}}/{{`{{`}}
$labels.deployment {{`}}`}} has not matched the expected number of
replicas for longer than {{ .for }}.
expr: |-
(
kube_deployment_spec_replicas{ {{- $deploymentSelector -}} }
!=
kube_deployment_status_replicas_available{ {{- $deploymentSelector -}} }
) and (
changes(kube_deployment_status_replicas_updated{ {{- $deploymentSelector -}} }[5m])
==
0
)
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- if $values.defaults.additionalRuleLabels }}
{{ toYaml $values.defaults.additionalRuleLabels | nindent 8 }}
{{- end }}
{{- end }}

{{ with .Values.containerRules.KubeStatefulSetReplicasMismatch -}}
- alert: KubeStatefulSetReplicasMismatch
annotations:
Expand Down
5 changes: 0 additions & 5 deletions charts/prometheus-alerts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ containerRules:
severity: warning
for: 15m

# Deployment has not matched the expected number of replicas
KubeDeploymentReplicasMismatch:
severity: warning
for: 15m

# Deployment has not matched the expected number of replicas
KubeStatefulSetReplicasMismatch:
severity: warning
Expand Down
53 changes: 0 additions & 53 deletions charts/rollout-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,59 +163,6 @@ spec:
- name: {{ .Release.Namespace }}.{{ .Release.Name }}.{{ .Chart.Name }}.DeploymentRules
rules:

{{- with .Values.prometheusRules.DeploymentGenerationMismatch }}
- alert: DeploymentGenerationMismatch
annotations:
summary: >-
{{`{{ $labels.deployment }}`}} deployment generation mismatch due to possible roll-back
runbook_url: {{ $runbookUrl }}#deploymentgenerationmismatch
description: >-
Deployment generation for {{`{{ $labels.namespace }}`}}/{{`{{ $labels.deployment }}`}}
does not match, this indicates that the Deployment has failed but has not been rolled
back.
expr: |-
sum by(namespace, deployment) (
kube_deployment_status_observed_generation{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}
!=
kube_deployment_metadata_generation{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}
)
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}

{{- with .Values.prometheusRules.DeploymentReplicasMismatch }}
- alert: DeploymentReplicasMismatch
annotations:
summary: >-
{{`{{ $labels.deployment }}`}} deployment has not matched the expected number of replicas.
runbook_url: {{ $runbookUrl }}#deploymentreplicasmismatch
description: >-
Deployment {{`{{ $labels.namespace }}`}}/{{`{{ $labels.deployment }}`}}
has not matched the expected number of replicas for longer than {{ .for }}.
expr: |-
sum by(namespace, deployment) (
(
kube_deployment_spec_replicas{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}
!=
kube_deployment_status_replicas_available{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}
) and (
changes(kube_deployment_status_replicas_updated{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}[5m])
==
0
)
)
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}

{{- if .Values.autoscaling.enabled }}
- name: {{ .Release.Namespace }}.{{ .Release.Name }}.{{ .Chart.Name }}.HorizontalPodAutoscalerRules
rules:
Expand Down
10 changes: 0 additions & 10 deletions charts/rollout-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -914,16 +914,6 @@ prometheusRules:
severity: warning
for: 1h

# -- Deployment generation mismatch due to possible roll-back
DeploymentGenerationMismatch:
severity: warning
for: 15m

# -- Deployment has not matched the expected number of replicas
DeploymentReplicasMismatch:
severity: warning
for: 15m

# -- HPA has not matched descired number of replicas
HpaReplicasMismatch:
severity: warning
Expand Down
34 changes: 0 additions & 34 deletions charts/simple-app/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,39 +187,6 @@ spec:
{{- end }}
{{- end }}

{{- with .Values.prometheusRules.DeploymentReplicasMismatch }}
- alert: DeploymentReplicasMismatch
annotations:
summary: >-
{{`{{ $labels.deployment }}`}} deployment has not matched the expected number of replicas.
runbook_url: {{ $runbookUrl }}#deploymentreplicasmismatch
description: >-
Deployment {{`{{ $labels.namespace }}`}}/{{`{{ $labels.deployment }}`}}
has not matched the expected number of replicas for longer than {{ .for }}.
expr: |-
sum by(namespace, deployment) (
(
kube_deployment_spec_replicas{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}
!=
kube_deployment_status_replicas_available{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}
) and (
changes(kube_deployment_status_replicas_updated{job="kube-state-metrics", namespace=~"{{ $targetNamespace }}", deployment="{{ $appName }}"}[5m])
==
0
)
)
for: {{ .for }}
labels:
severity: {{ .severity }}
{{- with $values.prometheusRules.additionalRuleLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}

{{- if .Values.autoscaling.enabled }}
- name: {{ .Release.Namespace }}.{{ .Release.Name }}.{{ .Chart.Name }}.HorizontalPodAutoscalerRules
rules:

{{- with .Values.prometheusRules.HpaReplicasMismatch }}
- alert: HpaReplicasMismatch
annotations:
Expand Down Expand Up @@ -279,4 +246,3 @@ spec:
{{- end }}

{{- end }}

5 changes: 0 additions & 5 deletions charts/simple-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -786,11 +786,6 @@ prometheusRules:
severity: warning
for: 15m

# -- Deployment has not matched the expected number of replicas
DeploymentReplicasMismatch:
severity: warning
for: 15m

# -- HPA has not matched descired number of replicas
HpaReplicasMismatch:
severity: warning
Expand Down

0 comments on commit 39d7c57

Please sign in to comment.