summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_prometheus/README.md2
-rw-r--r--roles/openshift_prometheus/defaults/main.yaml4
-rw-r--r--roles/openshift_prometheus/tasks/install_prometheus.yaml3
3 files changed, 9 insertions, 0 deletions
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_<COMPONENT>_hostname`: specify the hostname for the route of that compontent: defaults to `<COMPONENT>-{{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