Change rolling update strategy for deployments with aa

Change-Id: I8ca60bbda77712d78c6b675c348c19bf075bead8
This commit is contained in:
Andrey Pavlov 2017-03-21 22:50:25 +04:00
parent c8cffc034f
commit de44c2957f
1 changed files with 4 additions and 0 deletions

View File

@ -149,6 +149,10 @@ def parse_role(component, topology, configmaps, components_map):
replicas = CONF.replicas.get(service_name)
strategy = {'type': service.get('strategy', 'RollingUpdate')}
if strategy['type'] == 'RollingUpdate' and (
service.get("hostNetwork") or service.get("antiAffinity")):
strategy['rollingUpdate'] = {'maxSurge': 0,
'maxUnavailable': '50%'}
if service.get("kind") == 'DaemonSet':
LOG.warning("Deployment is being used instead of DaemonSet to support "
"updates")