diff options
author | Eric Sauer <esauer@redhat.com> | 2017-02-10 20:49:57 -0500 |
---|---|---|
committer | Eric Sauer <esauer@redhat.com> | 2017-02-10 20:49:57 -0500 |
commit | ea4501fd2b53f94eb3bfd3e83fa8fab57f0c7db2 (patch) | |
tree | 3a3684c3a06667f1efd79ea8b7822ace9891ce89 /roles/openshift_hosted | |
parent | 7c948bc637480e6d292b8af18b7a4c90b71d747c (diff) | |
download | openshift-ea4501fd2b53f94eb3bfd3e83fa8fab57f0c7db2.tar.gz openshift-ea4501fd2b53f94eb3bfd3e83fa8fab57f0c7db2.tar.bz2 openshift-ea4501fd2b53f94eb3bfd3e83fa8fab57f0c7db2.tar.xz openshift-ea4501fd2b53f94eb3bfd3e83fa8fab57f0c7db2.zip |
Making router pods scale with infra nodes
Diffstat (limited to 'roles/openshift_hosted')
-rw-r--r-- | roles/openshift_hosted/tasks/router/router.yml | 24 |
1 files changed, 24 insertions, 0 deletions
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 |