From a589db04e998f2934a5852b461c8721d18cfccb1 Mon Sep 17 00:00:00 2001 From: astebenkova Date: Mon, 25 Jan 2021 18:32:48 +0200 Subject: [PATCH] Add possibility to use overrides for some charts The deal is that all the jobs' scripts include extra arguments when deploying helm charts, except these ones in the commit. It would be useful to use override files in these charts. + Fix typo in apparmor.yaml for node-exporter + Amend apparmor.yaml for openstack-exporter since those values are already by default in values.yaml Change-Id: Ibe8b38977216e618dccba7e8443b3cc05a772de5 --- prometheus-node-exporter/Chart.yaml | 2 +- .../values_overrides/apparmor.yaml | 2 +- prometheus-openstack-exporter/Chart.yaml | 2 +- .../values_overrides/apparmor.yaml | 10 ---------- tools/deployment/common/070-kube-state-metrics.sh | 5 ++++- tools/deployment/common/080-node-exporter.sh | 5 ++++- tools/deployment/common/090-process-exporter.sh | 5 ++++- tools/deployment/common/alerta.sh | 7 ++++++- tools/deployment/common/openstack-exporter.sh | 6 +++++- 9 files changed, 26 insertions(+), 18 deletions(-) diff --git a/prometheus-node-exporter/Chart.yaml b/prometheus-node-exporter/Chart.yaml index 009ed86fe..a9be8198a 100644 --- a/prometheus-node-exporter/Chart.yaml +++ b/prometheus-node-exporter/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v0.18.1 description: OpenStack-Helm Node Exporter for Prometheus name: prometheus-node-exporter -version: 0.1.1 +version: 0.1.2 home: https://github.com/prometheus/node_exporter sources: - https://github.com/prometheus/node_exporter diff --git a/prometheus-node-exporter/values_overrides/apparmor.yaml b/prometheus-node-exporter/values_overrides/apparmor.yaml index 2aaa0f78d..125c15b23 100644 --- a/prometheus-node-exporter/values_overrides/apparmor.yaml +++ b/prometheus-node-exporter/values_overrides/apparmor.yaml @@ -4,5 +4,5 @@ pod: type: apparmor node-exporter: node-exporter: runtime/default - init: runrtime/default + init: runtime/default ... diff --git a/prometheus-openstack-exporter/Chart.yaml b/prometheus-openstack-exporter/Chart.yaml index 16f9fd8a7..c8ff30ee7 100644 --- a/prometheus-openstack-exporter/Chart.yaml +++ b/prometheus-openstack-exporter/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack Metrics Exporter for Prometheus name: prometheus-openstack-exporter -version: 0.1.2 +version: 0.1.3 home: https://github.com/openstack/openstack-helm-infra sources: - https://opendev.org/openstack/openstack-helm-infra diff --git a/prometheus-openstack-exporter/values_overrides/apparmor.yaml b/prometheus-openstack-exporter/values_overrides/apparmor.yaml index 8852e2950..8fd4fadba 100644 --- a/prometheus-openstack-exporter/values_overrides/apparmor.yaml +++ b/prometheus-openstack-exporter/values_overrides/apparmor.yaml @@ -8,14 +8,4 @@ pod: prometheus-openstack-exporter-ks-user: prometheus-openstack-exporter-ks-user: runtime/default init: runtime/default -manifests: - job_ks_user: true -dependencies: - static: - prometheus_openstack_exporter: - jobs: - - prometheus-openstack-exporter-ks-user - services: - - endpoint: internal - service: identity ... diff --git a/tools/deployment/common/070-kube-state-metrics.sh b/tools/deployment/common/070-kube-state-metrics.sh index bc7396b38..fda13918e 100755 --- a/tools/deployment/common/070-kube-state-metrics.sh +++ b/tools/deployment/common/070-kube-state-metrics.sh @@ -18,8 +18,11 @@ set -xe make prometheus-kube-state-metrics #NOTE: Deploy command +: ${OSH_INFRA_EXTRA_HELM_ARGS_KUBE_STATE_METRICS:="$(./tools/deployment/common/get-values-overrides.sh prometheus-kube-state-metrics)"} + helm upgrade --install prometheus-kube-state-metrics \ - ./prometheus-kube-state-metrics --namespace=kube-system + ./prometheus-kube-state-metrics --namespace=kube-system \ + ${OSH_INFRA_EXTRA_HELM_ARGS_KUBE_STATE_METRICS} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh kube-system diff --git a/tools/deployment/common/080-node-exporter.sh b/tools/deployment/common/080-node-exporter.sh index 600643eeb..4626ce6a2 100755 --- a/tools/deployment/common/080-node-exporter.sh +++ b/tools/deployment/common/080-node-exporter.sh @@ -18,8 +18,11 @@ set -xe make prometheus-node-exporter #NOTE: Deploy command +: ${OSH_INFRA_EXTRA_HELM_ARGS_NODE_EXPORTER:="$(./tools/deployment/common/get-values-overrides.sh prometheus-node-exporter)"} + helm upgrade --install prometheus-node-exporter \ - ./prometheus-node-exporter --namespace=kube-system + ./prometheus-node-exporter --namespace=kube-system \ + ${OSH_INFRA_EXTRA_HELM_ARGS_NODE_EXPORTER} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh kube-system diff --git a/tools/deployment/common/090-process-exporter.sh b/tools/deployment/common/090-process-exporter.sh index f39804df0..97cddfd95 100755 --- a/tools/deployment/common/090-process-exporter.sh +++ b/tools/deployment/common/090-process-exporter.sh @@ -18,8 +18,11 @@ set -xe make prometheus-process-exporter #NOTE: Deploy command +: ${OSH_INFRA_EXTRA_HELM_ARGS_PROCESS_EXPORTER:="$(./tools/deployment/common/get-values-overrides.sh prometheus-process-exporter)"} + helm upgrade --install prometheus-process-exporter \ - ./prometheus-process-exporter --namespace=kube-system + ./prometheus-process-exporter --namespace=kube-system \ + ${OSH_INFRA_EXTRA_HELM_ARGS_PROCESS_EXPORTER} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh kube-system diff --git a/tools/deployment/common/alerta.sh b/tools/deployment/common/alerta.sh index 98b0306bc..e01e2842b 100755 --- a/tools/deployment/common/alerta.sh +++ b/tools/deployment/common/alerta.sh @@ -18,8 +18,13 @@ set -xe make alerta #NOTE: Deploy command +: ${OSH_INFRA_EXTRA_HELM_ARGS:=""} +: ${OSH_INFRA_EXTRA_HELM_ARGS_ALERTA:="$(./tools/deployment/common/get-values-overrides.sh alerta)"} + helm upgrade --install alerta ./alerta \ - --namespace=osh-infra + --namespace=osh-infra \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_ALERTA} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/common/openstack-exporter.sh b/tools/deployment/common/openstack-exporter.sh index dc7ad1fab..ad3c7369a 100755 --- a/tools/deployment/common/openstack-exporter.sh +++ b/tools/deployment/common/openstack-exporter.sh @@ -18,6 +18,8 @@ set -xe make prometheus-openstack-exporter #NOTE: Deploy command +: ${OSH_INFRA_EXTRA_HELM_ARGS_OS_EXPORTER:="$(./tools/deployment/common/get-values-overrides.sh prometheus-openstack-exporter)"} + tee /tmp/prometheus-openstack-exporter.yaml << EOF manifests: job_ks_user: false @@ -27,10 +29,12 @@ dependencies: jobs: null services: null EOF + helm upgrade --install prometheus-openstack-exporter \ ./prometheus-openstack-exporter \ --namespace=openstack \ - --values=/tmp/prometheus-openstack-exporter.yaml + --values=/tmp/prometheus-openstack-exporter.yaml \ + ${OSH_INFRA_EXTRA_HELM_ARGS_OS_EXPORTER} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh openstack