From ea4501fd2b53f94eb3bfd3e83fa8fab57f0c7db2 Mon Sep 17 00:00:00 2001 From: Eric Sauer Date: Fri, 10 Feb 2017 20:49:57 -0500 Subject: Making router pods scale with infra nodes --- roles/openshift_hosted/tasks/router/router.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml index b944fa522..385a8ee39 100644 --- a/roles/openshift_hosted/tasks/router/router.yml +++ b/roles/openshift_hosted/tasks/router/router.yml @@ -78,3 +78,27 @@ changed_when: "'service exists' not in openshift_hosted_router_results.stdout" failed_when: "openshift_hosted_router_results.rc != 0 and 'service exists' not in openshift_hosted_router_results.stdout and 'deployment_config' not in openshift_hosted_router_results.stderr and 'service' not in openshift_hosted_router_results.stderr" when: replicas | int > 0 + +- command: > + {{ openshift.common.client_binary }} + {% if openshift.hosted.router.name | default(none) is not none -%} + get dc/{{ openshift.hosted.router.name }} + {% else %} + get dc/router + {% endif%} + --template=\\{\\{.spec.replicas\\}\\} + --namespace={{ openshift.hosted.router.namespace | default('default') }} + register: current_replicas + when: replicas | int > 0 + +- name: Ensure router replica count matches desired + command: > + {{ openshift.common.client_binary }} + scale --replicas={{ replicas }} + {% if openshift.hosted.router.name | default(none) is not none -%} + dc/{{ openshift.hosted.router.name }} + {% else %} + dc/router + {% endif%} + --namespace={{ openshift.hosted.router.namespace | default('default') }} + when: replicas | int > 0 and replicas | int != current_replicas.stdout | int -- cgit v1.2.3 From f92ea7c375239dce121154408987632d08d8d45f Mon Sep 17 00:00:00 2001 From: Eric Sauer Date: Mon, 13 Feb 2017 13:21:22 -0500 Subject: Removing trailing spaces --- roles/openshift_hosted/tasks/router/router.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/openshift_hosted/tasks/router/router.yml b/roles/openshift_hosted/tasks/router/router.yml index 385a8ee39..3d5713d6b 100644 --- a/roles/openshift_hosted/tasks/router/router.yml +++ b/roles/openshift_hosted/tasks/router/router.yml @@ -86,7 +86,7 @@ {% else %} get dc/router {% endif%} - --template=\\{\\{.spec.replicas\\}\\} + --template=\\{\\{.spec.replicas\\}\\} --namespace={{ openshift.hosted.router.namespace | default('default') }} register: current_replicas when: replicas | int > 0 @@ -94,7 +94,7 @@ - name: Ensure router replica count matches desired command: > {{ openshift.common.client_binary }} - scale --replicas={{ replicas }} + scale --replicas={{ replicas }} {% if openshift.hosted.router.name | default(none) is not none -%} dc/{{ openshift.hosted.router.name }} {% else %} -- cgit v1.2.3