2018-03-29 02:23:30 +08:00
|
|
|
---
|
|
|
|
- name: Metrics | Make sure Helm is installed
|
|
|
|
command: "{{ bin_dir }}/helm version"
|
2018-03-30 05:09:36 +08:00
|
|
|
register: helm_ready_result
|
|
|
|
until: helm_ready_result|succeeded
|
|
|
|
retries: 4
|
|
|
|
delay: 5
|
2018-03-30 03:51:46 +08:00
|
|
|
when:
|
2018-03-30 04:03:43 +08:00
|
|
|
- prometheus_operator_enabled
|
2018-03-30 03:51:46 +08:00
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
2018-03-29 02:23:30 +08:00
|
|
|
|
|
|
|
- name: Metrics | Add coreos repo
|
|
|
|
command: "{{ bin_dir }}/helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/"
|
2018-03-30 03:51:46 +08:00
|
|
|
when:
|
2018-03-30 04:03:43 +08:00
|
|
|
- prometheus_operator_enabled
|
2018-03-30 03:51:46 +08:00
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
2018-03-29 02:23:30 +08:00
|
|
|
run_once: true
|
|
|
|
|
|
|
|
- name: Metrics | Install Prometheus Operator
|
|
|
|
command: "{{ bin_dir }}/helm upgrade --install prometheus-operator coreos/prometheus-operator --namespace {{ monitoring_namespace }}"
|
2018-03-30 03:51:46 +08:00
|
|
|
when:
|
|
|
|
- prometheus_operator_enabled
|
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
2018-03-29 02:23:30 +08:00
|
|
|
run_once: true
|
|
|
|
|
|
|
|
- name: Metrics | Install K8s cluster metrics
|
|
|
|
command: "{{ bin_dir }}/helm upgrade --install kube-prometheus coreos/kube-prometheus --namespace {{ monitoring_namespace }}"
|
2018-03-30 05:09:36 +08:00
|
|
|
when:
|
2018-03-30 04:03:43 +08:00
|
|
|
- prometheus_operator_enabled
|
2018-03-30 03:51:46 +08:00
|
|
|
- k8s_metrics_enabled
|
|
|
|
- inventory_hostname == groups['kube-master'][0]
|
2018-03-29 02:23:30 +08:00
|
|
|
run_once: true
|