summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/tasks
diff options
context:
space:
mode:
authorJeff Cantrill <jcantrill@users.noreply.github.com>2017-01-06 11:27:18 -0500
committerJeff Cantrill <jcantril@redhat.com>2017-01-17 11:45:04 -0500
commitb097d9f595c378ce35a2d35f2bd4749c3aa5d77d (patch)
tree959b633ad3697912e37d6aa1a3bc3854ec1c95fe /roles/openshift_metrics/tasks
parent1e8928c96627218fdc422bfa3731f790699abfbb (diff)
downloadopenshift-b097d9f595c378ce35a2d35f2bd4749c3aa5d77d.tar.gz
openshift-b097d9f595c378ce35a2d35f2bd4749c3aa5d77d.tar.bz2
openshift-b097d9f595c378ce35a2d35f2bd4749c3aa5d77d.tar.xz
openshift-b097d9f595c378ce35a2d35f2bd4749c3aa5d77d.zip
set replicas to current value so not to disrupt current pods (#13)
Diffstat (limited to 'roles/openshift_metrics/tasks')
-rw-r--r--roles/openshift_metrics/tasks/install_hawkular.yaml20
-rw-r--r--roles/openshift_metrics/tasks/install_heapster.yaml9
2 files changed, 29 insertions, 0 deletions
diff --git a/roles/openshift_metrics/tasks/install_hawkular.yaml b/roles/openshift_metrics/tasks/install_hawkular.yaml
index 34a8c58b8..b377b6299 100644
--- a/roles/openshift_metrics/tasks/install_hawkular.yaml
+++ b/roles/openshift_metrics/tasks/install_hawkular.yaml
@@ -1,8 +1,27 @@
---
+- shell: >
+ {{ openshift.common.client_binary }} -n {{ openshift_metrics_project }}
+ --config={{ mktemp.stdout }}/admin.kubeconfig
+ get rc hawkular-metrics --template=\{\{.spec.replicas\}\} || echo 0
+ register: hawkular_metrics_replica_count
+ changed_when: false
+
- name: generate hawkular-metrics replication controller
template:
src: hawkular_metrics_rc.j2
dest: "{{ mktemp.stdout }}/templates/hawkular_metrics_rc.yaml"
+ vars:
+ replica_count: "{{hawkular_metrics_replica_count.stdout}}"
+
+- shell: >
+ {{ openshift.common.client_binary }} -n {{ openshift_metrics_project }}
+ --config={{ mktemp.stdout }}/admin.kubeconfig
+ get rc hawkular-cassandra-{{node}} --template=\{\{.spec.replicas\}\} || echo 0
+ vars:
+ node: "{{ item }}"
+ register: cassandra_replica_count
+ changed_when: false
+ with_sequence: count={{ openshift_metrics_cassandra_replicas }}
- name: generate hawkular-cassandra replication controllers
template:
@@ -11,6 +30,7 @@
vars:
node: "{{ item }}"
master: "{{ (item == '1')|string|lower }}"
+ replica_count: "{{cassandra_replica_count.results[item|int - 1].stdout}}"
with_sequence: count={{ openshift_metrics_cassandra_replicas }}
- name: generate hawkular-cassandra persistent volume claims
diff --git a/roles/openshift_metrics/tasks/install_heapster.yaml b/roles/openshift_metrics/tasks/install_heapster.yaml
index a8f849a88..63ea7e943 100644
--- a/roles/openshift_metrics/tasks/install_heapster.yaml
+++ b/roles/openshift_metrics/tasks/install_heapster.yaml
@@ -1,3 +1,12 @@
---
+- shell: >
+ {{ openshift.common.client_binary }} -n {{ openshift_metrics_project }}
+ --config={{ mktemp.stdout }}/admin.kubeconfig
+ get rc heapster --template=\{\{.spec.replicas\}\} || echo 0
+ register: heapster_replica_count
+ changed_when: false
+
- name: Generate heapster replication controller
template: src=heapster.j2 dest={{mktemp.stdout}}/templates/metrics-heapster-rc.yaml
+ vars:
+ replica_count: "{{heapster_replica_count.stdout}}"