From 24a25b94cf1b6b2f19cf12b3c8d54cd2bb0fd696 Mon Sep 17 00:00:00 2001 From: Diego Abelenda Date: Thu, 16 Nov 2017 15:24:25 +0100 Subject: Allow to set the hostname for routes to prometheus and alertmanager --- roles/openshift_prometheus/README.md | 2 ++ roles/openshift_prometheus/defaults/main.yaml | 4 ++++ roles/openshift_prometheus/tasks/install_prometheus.yaml | 3 +++ 3 files changed, 9 insertions(+) (limited to 'roles/openshift_prometheus') diff --git a/roles/openshift_prometheus/README.md b/roles/openshift_prometheus/README.md index 5bf6e7d77..9e43da5c3 100644 --- a/roles/openshift_prometheus/README.md +++ b/roles/openshift_prometheus/README.md @@ -25,6 +25,8 @@ For default values, see [`defaults/main.yaml`](defaults/main.yaml). - `openshift_prometheus_args`: Modify or add arguments for prometheus application +- `openshift_prometheus__hostname`: specify the hostname for the route of that compontent: defaults to `-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` + e.g ``` openshift_prometheus_args=['--storage.tsdb.retention=6h', '--storage.tsdb.min-block-duration=5s', '--storage.tsdb.max-block-duration=6m'] diff --git a/roles/openshift_prometheus/defaults/main.yaml b/roles/openshift_prometheus/defaults/main.yaml index 1b4a12cac..d7ec42c47 100644 --- a/roles/openshift_prometheus/defaults/main.yaml +++ b/roles/openshift_prometheus/defaults/main.yaml @@ -4,6 +4,10 @@ openshift_prometheus_state: present openshift_prometheus_namespace: openshift-metrics +# defaults hosts for routes +openshift_prometheus_prometheus_hostname: prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}} +openshift_prometheus_alerts_hostname: alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}} + openshift_prometheus_node_selector: {"region":"infra"} # additional prometheus rules file diff --git a/roles/openshift_prometheus/tasks/install_prometheus.yaml b/roles/openshift_prometheus/tasks/install_prometheus.yaml index 50736a9ee..1241c371a 100644 --- a/roles/openshift_prometheus/tasks/install_prometheus.yaml +++ b/roles/openshift_prometheus/tasks/install_prometheus.yaml @@ -113,12 +113,15 @@ oc_route: state: present name: "{{ item.name }}" + host: "{{ item.host }}" namespace: "{{ openshift_prometheus_namespace }}" service_name: "{{ item.name }}" tls_termination: reencrypt with_items: - name: prometheus + host: "{{ openshift_prometheus_prometheus_hostname }}" - name: alerts + host: "{{ openshift_prometheus_alerts_hostname }}" # Storage - name: create prometheus pvc -- cgit v1.2.3 From 984655cb741278409f065474776b55eec8b75134 Mon Sep 17 00:00:00 2001 From: Diego Abelenda Date: Mon, 20 Nov 2017 16:25:46 +0100 Subject: Change the name of the variable and explicitely document the names --- roles/openshift_prometheus/README.md | 4 +++- roles/openshift_prometheus/tasks/install_prometheus.yaml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'roles/openshift_prometheus') diff --git a/roles/openshift_prometheus/README.md b/roles/openshift_prometheus/README.md index 9e43da5c3..f1bbb3ca6 100644 --- a/roles/openshift_prometheus/README.md +++ b/roles/openshift_prometheus/README.md @@ -25,7 +25,9 @@ For default values, see [`defaults/main.yaml`](defaults/main.yaml). - `openshift_prometheus_args`: Modify or add arguments for prometheus application -- `openshift_prometheus__hostname`: specify the hostname for the route of that compontent: defaults to `-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` +- `openshift_prometheus_hostname`: specify the hostname for the route to prometheus `prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` + +- `openshift_prometheus_alerts_hostname`: specify the hostname for the route to prometheus `prometheus_alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` e.g ``` diff --git a/roles/openshift_prometheus/tasks/install_prometheus.yaml b/roles/openshift_prometheus/tasks/install_prometheus.yaml index 1241c371a..ad15dc65f 100644 --- a/roles/openshift_prometheus/tasks/install_prometheus.yaml +++ b/roles/openshift_prometheus/tasks/install_prometheus.yaml @@ -119,7 +119,7 @@ tls_termination: reencrypt with_items: - name: prometheus - host: "{{ openshift_prometheus_prometheus_hostname }}" + host: "{{ openshift_prometheus_hostname }}" - name: alerts host: "{{ openshift_prometheus_alerts_hostname }}" -- cgit v1.2.3 From 6f22fa41f0a800190d14d80aa540cc8897a86114 Mon Sep 17 00:00:00 2001 From: Diego Abelenda Date: Mon, 20 Nov 2017 16:29:53 +0100 Subject: Missed the default value after the variable name change... --- roles/openshift_prometheus/defaults/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_prometheus') diff --git a/roles/openshift_prometheus/defaults/main.yaml b/roles/openshift_prometheus/defaults/main.yaml index d7ec42c47..df331a4bb 100644 --- a/roles/openshift_prometheus/defaults/main.yaml +++ b/roles/openshift_prometheus/defaults/main.yaml @@ -5,7 +5,7 @@ openshift_prometheus_state: present openshift_prometheus_namespace: openshift-metrics # defaults hosts for routes -openshift_prometheus_prometheus_hostname: prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}} +openshift_prometheus_hostname: prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}} openshift_prometheus_alerts_hostname: alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}} openshift_prometheus_node_selector: {"region":"infra"} -- cgit v1.2.3 From 47f9f058bf50ade64ec43686144e8d1227dfd77c Mon Sep 17 00:00:00 2001 From: Diego Abelenda Date: Mon, 20 Nov 2017 16:47:19 +0100 Subject: Fix name of the service pointed to by hostname --- roles/openshift_prometheus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/openshift_prometheus') diff --git a/roles/openshift_prometheus/README.md b/roles/openshift_prometheus/README.md index f1bbb3ca6..f1eca1da6 100644 --- a/roles/openshift_prometheus/README.md +++ b/roles/openshift_prometheus/README.md @@ -27,7 +27,7 @@ For default values, see [`defaults/main.yaml`](defaults/main.yaml). - `openshift_prometheus_hostname`: specify the hostname for the route to prometheus `prometheus-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` -- `openshift_prometheus_alerts_hostname`: specify the hostname for the route to prometheus `prometheus_alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` +- `openshift_prometheus_alerts_hostname`: specify the hostname for the route to prometheus-alerts `prometheus_alerts-{{openshift_prometheus_namespace}}.{{openshift_master_default_subdomain}}` e.g ``` -- cgit v1.2.3