summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics
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
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')
-rw-r--r--roles/openshift_metrics/tasks/install_hawkular.yaml20
-rw-r--r--roles/openshift_metrics/tasks/install_heapster.yaml9
-rw-r--r--roles/openshift_metrics/templates/hawkular_cassandra_rc.j22
-rw-r--r--roles/openshift_metrics/templates/hawkular_metrics_rc.j22
-rw-r--r--roles/openshift_metrics/templates/heapster.j22
5 files changed, 32 insertions, 3 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}}"
diff --git a/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2 b/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
index 9a1c446cd..48ef3290d 100644
--- a/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
+++ b/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
@@ -9,7 +9,7 @@ metadata:
spec:
selector:
name: hawkular-cassandra-{{ node }}
- replicas: 0
+ replicas: {{replica_count}}
template:
version: v1
metadata:
diff --git a/roles/openshift_metrics/templates/hawkular_metrics_rc.j2 b/roles/openshift_metrics/templates/hawkular_metrics_rc.j2
index 1397276e6..e6954ea44 100644
--- a/roles/openshift_metrics/templates/hawkular_metrics_rc.j2
+++ b/roles/openshift_metrics/templates/hawkular_metrics_rc.j2
@@ -8,7 +8,7 @@ metadata:
spec:
selector:
name: hawkular-metrics
- replicas: 0
+ replicas: {{replica_count}}
template:
version: v1
metadata:
diff --git a/roles/openshift_metrics/templates/heapster.j2 b/roles/openshift_metrics/templates/heapster.j2
index f64c6696e..eeca03be0 100644
--- a/roles/openshift_metrics/templates/heapster.j2
+++ b/roles/openshift_metrics/templates/heapster.j2
@@ -8,7 +8,7 @@ metadata:
spec:
selector:
name: heapster
- replicas: 0
+ replicas: {{replica_count}}
template:
version: v1
metadata: