From f72430739db40b888a25af47db387b42120e149b Mon Sep 17 00:00:00 2001 From: Dan Sexton Date: Thu, 9 Jul 2020 10:16:31 -0400 Subject: [PATCH] [stable/prometheus-operator] Added option to disable kube-apiserver-availability rules (#23136) Signed-off-by: Dan Sexton --- stable/prometheus-operator/Chart.yaml | 2 +- stable/prometheus-operator/README.md | 1 + stable/prometheus-operator/hack/sync_prometheus_rules.py | 1 + .../rules-1.14/kube-apiserver-availability.rules.yaml | 2 +- stable/prometheus-operator/values.yaml | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stable/prometheus-operator/Chart.yaml b/stable/prometheus-operator/Chart.yaml index 115c44691e2f..47e4dd149ec2 100644 --- a/stable/prometheus-operator/Chart.yaml +++ b/stable/prometheus-operator/Chart.yaml @@ -12,7 +12,7 @@ sources: - https://github.com/coreos/kube-prometheus - https://github.com/coreos/prometheus-operator - https://coreos.com/operators/prometheus -version: 8.16.0 +version: 8.16.1 appVersion: 0.38.1 tillerVersion: ">=2.12.0" home: https://github.com/coreos/prometheus-operator diff --git a/stable/prometheus-operator/README.md b/stable/prometheus-operator/README.md index 8a7893e8399d..4847fed120c8 100644 --- a/stable/prometheus-operator/README.md +++ b/stable/prometheus-operator/README.md @@ -153,6 +153,7 @@ The following tables list the configurable parameters of the prometheus-operator | `defaultRules.rules.general` | Create General default rules| `true` | | `defaultRules.rules.k8s` | Create K8S default rules| `true` | | `defaultRules.rules.kubeApiserver` | Create Api Server default rules| `true` | +| `defaultRules.rules.kubeApiserverAvailability` | Create Api Server Availability default rules| `true` | | `defaultRules.rules.kubeApiserverError` | Create Api Server Error default rules| `true` | | `defaultRules.rules.kubeApiserverSlos` | Create Api Server SLOs default rules| `true` | | `defaultRules.rules.kubelet` | Create kubelet default rules | `true` | diff --git a/stable/prometheus-operator/hack/sync_prometheus_rules.py b/stable/prometheus-operator/hack/sync_prometheus_rules.py index df3bf92d05ab..b29eb41f03ac 100755 --- a/stable/prometheus-operator/hack/sync_prometheus_rules.py +++ b/stable/prometheus-operator/hack/sync_prometheus_rules.py @@ -54,6 +54,7 @@ def new_representer(dumper, data): 'general.rules': ' .Values.defaultRules.rules.general', 'k8s.rules': ' .Values.defaultRules.rules.k8s', 'kube-apiserver.rules': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserver', + 'kube-apiserver-availability.rules': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverAvailability', 'kube-apiserver-error': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverError', 'kube-apiserver-slos': ' .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverSlos', 'kube-prometheus-general.rules': ' .Values.defaultRules.rules.kubePrometheusGeneral', diff --git a/stable/prometheus-operator/templates/prometheus/rules-1.14/kube-apiserver-availability.rules.yaml b/stable/prometheus-operator/templates/prometheus/rules-1.14/kube-apiserver-availability.rules.yaml index 25b2bf08dedf..980fe5324c46 100644 --- a/stable/prometheus-operator/templates/prometheus/rules-1.14/kube-apiserver-availability.rules.yaml +++ b/stable/prometheus-operator/templates/prometheus/rules-1.14/kube-apiserver-availability.rules.yaml @@ -4,7 +4,7 @@ Do not change in-place! In order to change this file first read following link: https://github.com/helm/charts/tree/master/stable/prometheus-operator/hack */ -}} {{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }} -{{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create }} +{{- if and (semverCompare ">=1.14.0-0" $kubeTargetVersion) (semverCompare "<9.9.9-9" $kubeTargetVersion) .Values.defaultRules.create .Values.kubeApiServer.enabled .Values.defaultRules.rules.kubeApiserverAvailability }} apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: diff --git a/stable/prometheus-operator/values.yaml b/stable/prometheus-operator/values.yaml index f322c8d553dc..155ca783b72c 100644 --- a/stable/prometheus-operator/values.yaml +++ b/stable/prometheus-operator/values.yaml @@ -34,6 +34,7 @@ defaultRules: general: true k8s: true kubeApiserver: true + kubeApiserverAvailability: true kubeApiserverError: true kubeApiserverSlos: true kubelet: true