summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-04-25 12:12:03 -0400
committerJason DeTiberus <detiber@gmail.com>2016-04-25 12:12:03 -0400
commitfb0c88c4246207f8b6132082c8bf67145df9ea01 (patch)
tree7eba18ae7abc8e40b7f1e91680ebcb3ba747d6e3
parent7d36acbb53ab74d43539baca9a2e2b924778e960 (diff)
parent4ab567373c88bfed96f64eab6b721accc1ac9752 (diff)
downloadopenshift-fb0c88c4246207f8b6132082c8bf67145df9ea01.tar.gz
openshift-fb0c88c4246207f8b6132082c8bf67145df9ea01.tar.bz2
openshift-fb0c88c4246207f8b6132082c8bf67145df9ea01.tar.xz
openshift-fb0c88c4246207f8b6132082c8bf67145df9ea01.zip
Merge pull request #1786 from enoodle/additional_features_metrics
openshift-metrics: adding duration and resolution options
-rw-r--r--playbooks/common/openshift-master/config.yml6
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py2
-rw-r--r--roles/openshift_metrics/README.md2
-rw-r--r--roles/openshift_metrics/tasks/main.yaml8
4 files changed, 15 insertions, 3 deletions
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml
index c9d94bec5..0b0faaa22 100644
--- a/playbooks/common/openshift-master/config.yml
+++ b/playbooks/common/openshift-master/config.yml
@@ -42,6 +42,12 @@
- set_fact:
openshift_hosted_metrics_deploy: "{{ lookup('oo_option', 'openshift_hosted_metrics_deploy') | default(false, true) }}"
when: openshift_hosted_metrics_deploy is not defined
+ - set_fact:
+ openshift_hosted_metrics_duration: "{{ lookup('oo_option', 'openshift_hosted_metrics_duration') | default(7) }}"
+ when: openshift_hosted_metrics_duration is not defined
+ - set_fact:
+ openshift_hosted_metrics_resolution: "{{ lookup('oo_option', 'openshift_hosted_metrics_resolution') | default(10) }}"
+ when: openshift_hosted_metrics_resolution is not defined
roles:
- openshift_facts
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 48b117b8f..7de8b1006 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1644,6 +1644,8 @@ class OpenShiftFacts(object):
defaults['hosted'] = dict(
metrics=dict(
deploy=False,
+ duration=7,
+ resolution=10,
storage=dict(
kind=None,
volume=dict(
diff --git a/roles/openshift_metrics/README.md b/roles/openshift_metrics/README.md
index 610917d7d..ec13d61d2 100644
--- a/roles/openshift_metrics/README.md
+++ b/roles/openshift_metrics/README.md
@@ -19,6 +19,8 @@ From this role:
| openshift_hosted_metrics_storage_volume_name | metrics | Metrics volume within openshift_hosted_metrics_volume_dir |
| openshift_hosted_metrics_storage_volume_size | 10Gi | Metrics volume size |
| openshift_hosted_metrics_storage_nfs_options | *(rw,root_squash) | NFS options for configured exports. |
+| openshift_hosted_metrics_duration | 7 | Metrics query duration |
+| openshift_hosted_metrics_resolution | 10 | Metrics resolution |
From openshift_common:
diff --git a/roles/openshift_metrics/tasks/main.yaml b/roles/openshift_metrics/tasks/main.yaml
index 1a86cb1ea..ca29ad6e1 100644
--- a/roles/openshift_metrics/tasks/main.yaml
+++ b/roles/openshift_metrics/tasks/main.yaml
@@ -20,6 +20,7 @@
{{ openshift.common.client_binary }}
secrets new metrics-deployer
nothing=/dev/null
+ --config={{hawkular_tmp_conf}}
-n openshift-infra
register: deployer_create_secret
failed_when: "'already exists' not in deployer_create_secret.stderr and deployer_create_secret.rc !=0"
@@ -43,8 +44,9 @@
shell: >
{{ openshift.common.client_binary }} process -f \
/usr/share/openshift/examples/infrastructure-templates/{{ hawkular_type }}/metrics-deployer.yaml -v \
- HAWKULAR_METRICS_HOSTNAME=hawkular-metrics.{{ openshift.master.default_subdomain }},USE_PERSISTENT_STORAGE={{ hawkular_persistence }} | \
- {{ openshift.common.client_binary }} create -n openshift-infra -f -
+ HAWKULAR_METRICS_HOSTNAME=hawkular-metrics.{{ openshift.master.default_subdomain }} USE_PERSISTENT_STORAGE={{ hawkular_persistence }} \
+ METRIC_DURATION={{ openshift.hosted.metrics.duration }} METRIC_RESOLUTION={{ openshift.hosted.metrics.resolution }} |
+ {{ openshift.common.client_binary }} create -n openshift-infra --config={{hawkular_tmp_conf}} -f -
register: oex_heapster_services
failed_when: "'already exists' not in oex_heapster_services.stderr and oex_heapster_services.rc != 0"
changed_when: false
@@ -52,4 +54,4 @@
- name: Clean temporary config file
command: >
rm -rf {{hawkular_tmp_conf}}
- changed_when: false \ No newline at end of file
+ changed_when: false