From 23b3833806697c7488c1c6865e7ed4eb2e99db95 Mon Sep 17 00:00:00 2001 From: Vladimir Vasilkin Date: Thu, 29 Mar 2018 22:51:46 +0300 Subject: [PATCH] running on the first master only. --- roles/kubernetes-apps/metrics/tasks/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/roles/kubernetes-apps/metrics/tasks/main.yml b/roles/kubernetes-apps/metrics/tasks/main.yml index f64433c69..bda7d36e6 100644 --- a/roles/kubernetes-apps/metrics/tasks/main.yml +++ b/roles/kubernetes-apps/metrics/tasks/main.yml @@ -1,17 +1,25 @@ --- - name: Metrics | Make sure Helm is installed command: "{{ bin_dir }}/helm version" + when: + - inventory_hostname == groups['kube-master'][0] - name: Metrics | Add coreos repo command: "{{ bin_dir }}/helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/" + when: + - inventory_hostname == groups['kube-master'][0] run_once: true - name: Metrics | Install Prometheus Operator command: "{{ bin_dir }}/helm upgrade --install prometheus-operator coreos/prometheus-operator --namespace {{ monitoring_namespace }}" - when: prometheus_operator_enabled + when: + - prometheus_operator_enabled + - inventory_hostname == groups['kube-master'][0] run_once: true - name: Metrics | Install K8s cluster metrics command: "{{ bin_dir }}/helm upgrade --install kube-prometheus coreos/kube-prometheus --namespace {{ monitoring_namespace }}" - when: k8s_metrics_enabled + when: + - k8s_metrics_enabled + - inventory_hostname == groups['kube-master'][0] run_once: true