From ddd5a74319142b14d42271da6727e76637133869 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Wed, 4 Dec 2019 08:48:20 -0600 Subject: [PATCH] Prometheus: Add feature-gate support in deployment scripts This updates the deployment scripts for Prometheus to leverage the feature gate functionality rather than bash generation of the list of override files to use for alerting rules Change-Id: Ie497ae930f7cc4db690a4ddc812a92e4491cde93 Signed-off-by: Steve Wilkerson --- .../{logging.yaml => elasticsearch.yaml} | 20 +------------------ tools/deployment/multinode/050-prometheus.sh | 7 ++++++- .../osh-infra-monitoring/050-prometheus.sh | 9 ++++----- 3 files changed, 11 insertions(+), 25 deletions(-) rename prometheus/values_overrides/{logging.yaml => elasticsearch.yaml} (85%) diff --git a/prometheus/values_overrides/logging.yaml b/prometheus/values_overrides/elasticsearch.yaml similarity index 85% rename from prometheus/values_overrides/logging.yaml rename to prometheus/values_overrides/elasticsearch.yaml index 91151ca82..ca185a2e1 100644 --- a/prometheus/values_overrides/logging.yaml +++ b/prometheus/values_overrides/elasticsearch.yaml @@ -1,26 +1,8 @@ conf: prometheus: rules: - logging: + elasticsearch: groups: - - name: fluentd.rules - rules: - - alert: prom_exporter_fluentd_unavailable - expr: absent(fluentd_up) - for: 10m - labels: - severity: warning - annotations: - description: Fluentd exporter is not collecting metrics or is not available for past 10 minutes - title: Fluentd exporter is not collecting metrics or is not available - - alert: fluentd_not_running - expr: fluentd_up == 0 - for: 5m - labels: - severity: page - annotations: - description: 'fluentd is down on {{$labels.instance}} for more than 5 minutes' - summary: 'Fluentd is down' - name: elasticsearch.rules rules: - alert: prom_exporter_elasticsearch_unavailable diff --git a/tools/deployment/multinode/050-prometheus.sh b/tools/deployment/multinode/050-prometheus.sh index dfc1cefaa..e944545c6 100755 --- a/tools/deployment/multinode/050-prometheus.sh +++ b/tools/deployment/multinode/050-prometheus.sh @@ -19,10 +19,15 @@ set -xe #NOTE: Lint and package chart make prometheus +FEATURE_GATES="alertmanager,ceph,elasticsearch,kubernetes,nodes,openstack,postgresql" +: ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS:="$({ ./tools/deployment/common/get-values-overrides.sh prometheus;} 2> /dev/null)"} + #NOTE: Deploy command helm upgrade --install prometheus ./prometheus \ --namespace=osh-infra \ - --set pod.replicas.prometheus=2 + --set pod.replicas.prometheus=2 \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/osh-infra-monitoring/050-prometheus.sh b/tools/deployment/osh-infra-monitoring/050-prometheus.sh index 9865c421c..4c3ff11e2 100755 --- a/tools/deployment/osh-infra-monitoring/050-prometheus.sh +++ b/tools/deployment/osh-infra-monitoring/050-prometheus.sh @@ -19,15 +19,14 @@ set -xe #NOTE: Lint and package chart make prometheus -rules_overrides="" -for rules_file in $(ls ./prometheus/values_overrides); do - rules_overrides="$rules_overrides --values=./prometheus/values_overrides/$rules_file" -done +FEATURE_GATES="alertmanager,ceph,elasticsearch,kubernetes,nodes,openstack,postgresql" +: ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS:="$({ ./tools/deployment/common/get-values-overrides.sh prometheus;} 2> /dev/null)"} #NOTE: Deploy command helm upgrade --install prometheus ./prometheus \ --namespace=osh-infra \ - $rules_overrides + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_PROMETHEUS} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra