From 39d7c57c64ed8788f33ae14d7591a45e78876102 Mon Sep 17 00:00:00 2001 From: Matt Wise Date: Fri, 15 Dec 2023 09:26:44 -0800 Subject: [PATCH] chore(charts/app): remove some bad alerts --- .../templates/containers-prometheusrule.yaml | 27 ---------- charts/prometheus-alerts/values.yaml | 5 -- .../templates/prometheusrules.yaml | 53 ------------------- charts/rollout-app/values.yaml | 10 ---- .../simple-app/templates/prometheusrules.yaml | 34 ------------ charts/simple-app/values.yaml | 5 -- 6 files changed, 134 deletions(-) diff --git a/charts/prometheus-alerts/templates/containers-prometheusrule.yaml b/charts/prometheus-alerts/templates/containers-prometheusrule.yaml index 6abd5873..a4136a23 100644 --- a/charts/prometheus-alerts/templates/containers-prometheusrule.yaml +++ b/charts/prometheus-alerts/templates/containers-prometheusrule.yaml @@ -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: diff --git a/charts/prometheus-alerts/values.yaml b/charts/prometheus-alerts/values.yaml index 52b1d2e2..ab586f35 100644 --- a/charts/prometheus-alerts/values.yaml +++ b/charts/prometheus-alerts/values.yaml @@ -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 diff --git a/charts/rollout-app/templates/prometheusrules.yaml b/charts/rollout-app/templates/prometheusrules.yaml index 10eeb1c7..9a3f85a1 100644 --- a/charts/rollout-app/templates/prometheusrules.yaml +++ b/charts/rollout-app/templates/prometheusrules.yaml @@ -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: diff --git a/charts/rollout-app/values.yaml b/charts/rollout-app/values.yaml index 8b946fde..92598ca5 100644 --- a/charts/rollout-app/values.yaml +++ b/charts/rollout-app/values.yaml @@ -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 diff --git a/charts/simple-app/templates/prometheusrules.yaml b/charts/simple-app/templates/prometheusrules.yaml index b5965f7b..db46d1e6 100644 --- a/charts/simple-app/templates/prometheusrules.yaml +++ b/charts/simple-app/templates/prometheusrules.yaml @@ -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: @@ -279,4 +246,3 @@ spec: {{- end }} {{- end }} - diff --git a/charts/simple-app/values.yaml b/charts/simple-app/values.yaml index 1283b144..a5a4dd5b 100644 --- a/charts/simple-app/values.yaml +++ b/charts/simple-app/values.yaml @@ -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