Repository: zalando-incubator/kubernetes-on-aws
Issue: Cluster update does not preserve --max-worker-nodes

Updating a cluster will reset the ASG "max" property to the "DesiredCapacity" --- but it should keep the `--max-worker-nodes` as ASG "max".

```
 $ ./cluster.py update kube 1 --max-worker-nodes=10 --instance-type=r4.large --scalyr-access-key=abcAI- --force
Cluster ID is:          aws:XXX:eu-central-1:kube-1
API server endpoint is: https://kube-1.example.org
Master nodes:           1
Worker nodes:           2
Instance type:          r4.large
Generating Cloud Formation template..You are deploying an internet-facing ELB that will be publicly accessible! You should have OAUTH2 and HTTPS in place!
 OK
Updating Cloud Formation stack kube-1.. OK
Waiting up to 600 more secs for stack kube-1 (UPDATE_IN_PROGRESS)..
Waiting up to 595 more secs for stack kube-1 (UPDATE_IN_PROGRESS)..
Waiting up to 589 more secs for stack kube-1 (UPDATE_IN_PROGRESS)..
Waiting up to 584 more secs for stack kube-1 (UPDATE_IN_PROGRESS)..
OK: Stack(s) kube-1 updated successfully.
Suspending scaling processes for kube-1-MasterAutoScaling-JN4V3MRXJG77.. OK
Scaling up to 2 instances.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OK
Scaling down to 1 instances.. OK
Resuming scaling processes for kube-1-MasterAutoScaling-JN4V3MRXJG77.. OK
Waiting for API server https://kube-1.example.org .. OK
Suspending scaling processes for kube-1-WorkerAutoScaling-1NG7GQMDGWPI5.. OK
Scaling up to 3 instances.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OK
Scaling down to 2 instances.. OK
Resuming scaling processes for kube-1-WorkerAutoScaling-1NG7GQMDGWPI5.. OK


Changed files:
cluster/cluster.py

diff --git a/cluster/cluster.py b/cluster/cluster.py
index df8bd2ba..e5ec4baa 100755
--- a/cluster/cluster.py
+++ b/cluster/cluster.py
@@ -340,7 +340,7 @@ def update(stack_name, version, dry_run, force, instance_type, master_nodes, wor
     info('Cluster ID is:          {}'.format(variables['cluster_id']))
     info('API server endpoint is: {}'.format(variables['api_server']))
     info('Master nodes:           {}'.format(master_nodes))
-    info('Worker nodes:           {}'.format(worker_nodes))
+    info('Worker nodes:           {}, max: {}'.format(worker_nodes, max_worker_nodes))
     info('Instance type:          {}'.format(instance_type))
 
     if not dry_run:
@@ -462,6 +462,8 @@ def perform_node_updates(stack_name, version, name_filter, desired_user_data, co
 
     group = autoscaling.describe_auto_scaling_groups(AutoScalingGroupNames=[asg_name])['AutoScalingGroups'][0]
     old_desired_capacity = group['DesiredCapacity']
+    old_min_size = group['MinSize']
+    old_max_size = group['MaxSize']
     new_desired_capacity = old_desired_capacity + 1
     # scale out
     with Action('Scaling up to {} instances..'.format(new_desired_capacity)) as act:
@@ -503,8 +505,8 @@ def perform_node_updates(stack_name, version, name_filter, desired_user_data, co
 
     with Action('Scaling down to {} instances..'.format(old_desired_capacity)) as act:
         autoscaling.update_auto_scaling_group(AutoScalingGroupName=asg_name,
-                                              MinSize=old_desired_capacity,
-                                              MaxSize=old_desired_capacity,
+                                              MinSize=old_min_size,
+                                              MaxSize=old_max_size,
                                               DesiredCapacity=old_desired_capacity)
 
     with Action('Resuming scaling processes for {}..'.format(asg_name)):