From f51ec719a8ad59d23c9b08d1a276852c1ef58ef3 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Thu, 7 Jul 2016 07:56:11 -0700 Subject: [PATCH] Minor doc edits. --- Longhelp.md | 19 ++++--------------- README.md | 14 +++++++------- zdd.py | 8 ++++---- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/Longhelp.md b/Longhelp.md index 4f9f6668..91cffb5b 100644 --- a/Longhelp.md +++ b/Longhelp.md @@ -1017,20 +1017,6 @@ The target number of app instances to seek during deployment. You generally do not need to modify this unless you implement your own deployment orchestrator. -## `HAPROXY_DEPLOYMENT_NEW_INSTANCES` - *per app* - -Specified as `HAPROXY_DEPLOYMENT_NEW_INSTANCES`. - -The number of instances to be created in new group while doing -blue-green deployments. You generally do not need to modify this -unless you implement your own blue green deployment orchestrator. - -Ex: In zdd , if `haproxy_deployment_target_instances` is 10 and current -deployment color is `blue`, if you run zdd with `--new-instances` as 2, -there will be 2 instances created in `green` group and 2 deleted from `blue`. -So it will be blue:green with 80:20 ratio. - ## `HAPROXY_{n}_GROUP` *per service port* @@ -1162,4 +1148,7 @@ evaluated in the order it appears in the configuration. Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com'` -Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com,marathon'` \ No newline at end of file +Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com,marathon'` + + + diff --git a/README.md b/README.md index 40644492..8a4935df 100644 --- a/README.md +++ b/README.md @@ -293,32 +293,32 @@ The ZDD script includes the ability to specify a pre-kill hook, which is execute ## Traffic splitting between Blue and Green Apps. - Zdd has support to split the traffic between two versions of same app(Version blue and Version green) by having instances of both versions live at the same time. This is supported with the help of `HAPROXY_DEPLOYMENT_NEW_INSTANCES` label. When you run zdd with `--new-instances` flag , it creates only the specified number of instances in new app, and deletes the same number of instances from old app (instead of the normal, create all instances in new and delete all from old approach), to ensure that the number of instances in new app and old app together is equal to `HAPROXY_DEPLOYMENT_TARGET_INSTANCES`. -Example : Consider the same nginx app example where there are 10 instances of nginx running image version V1, now we can use zdd to create 2 instances of version V2, and retain 8 instances of V1 so that traffic is split in ratio 80:20 (old:new). +Example: Consider the same nginx app example where there are 10 instances of nginx running image version V1, now we can use zdd to create 2 instances of version V2, and retain 8 instances of V1 so that traffic is split in ratio 80:20 (old:new). Creating 2 instances with new version automatically deletes 2 instances in existing version.You could do this using the following command: +```console +$ ./zdd.py -j 1-nginx.json -m http://master.mesos:8080 -f -l http://marathon-lb.marathon.mesos:9090 --syslog-socket /dev/null --new-instances 2 ``` -./zdd.py -j 1-nginx.json -m http://master.mesos:8080 -f -l http://marathon-lb.marathon.mesos:9090 --syslog-socket /dev/null --new-instances 2 -``` + This state where you have instances of both old and new versions of same app live at the same time is called hybrid state. When a deployment group is in hybrid state, it needs to be converted into completely current version or completely previous version before deploying any further versions, this could be done with the help of `--complete-cur` and `--complete-prev` flags in zdd. When you run the below command to convert all instances to new version so that traffic split ratio becomes 0:100 (old:new) and it deletes the old app. This is graceful as it follows usual zdd procedure of waiting for tasks/instances to drain before deleting them. +```console +$ ./zdd.py -j 1-nginx.json -m http://master.mesos:8080 -f -l http://marathon-lb.marathon.mesos:9090 --syslog-socket /dev/null --complete-cur ``` -./zdd.py -j 1-nginx.json -m http://master.mesos:8080 -f -l http://marathon-lb.marathon.mesos:9090 --syslog-socket /dev/null --complete-cur -``` + Similarly you can use `--complete-prev` flag to convert all instances to old version (This is essentially a rollback) so that traffic split ratio becomes 100:0 (old:new) and it deletes the new app. Currently only one hop of traffic split is supported, so you can specify the number of new instances (directly proportional to traffic split ratio) only when app is having all instances of same version(completely blue or completely green). This implies `--new-instances` flag cannot be specified in hybrid mode to change traffic split ratio (instance ratio) as updating marathon label (`HAPROXY_DEPLOYMENT_NEW_INSTANCES`) currently triggers new deployment in marathon which will not be graceful. Once marathon supports dynamic labels we can have multiple hops of traffic split ratio. Currently for the example mentioned, the traffic split ratio is 100:0--->`80:20`--->0:100 , where there is only one hop when both versions get traffic simultaneously. - ## Mesos with IP-per-task support Marathon-lb supports load balancing for applications that use the Mesos IP-per-task diff --git a/zdd.py b/zdd.py index 1df1f235..0541bf49 100755 --- a/zdd.py +++ b/zdd.py @@ -704,11 +704,11 @@ def get_arg_parser(): " and green at the same time", type=int, default=0) parser.add_argument("--complete-cur", "-c", - help="Change hybrid app to completely" - " current app's instances", action="store_true") + help="Change hybrid app entirely to" + " current (new) app's instances", action="store_true") parser.add_argument("--complete-prev", "-p", - help="Change hybrid app to completely" - " previous app's instances", action="store_true") + help="Change hybrid app entirely to" + " previous (old) app's instances", action="store_true") parser.add_argument("--pre-kill-hook", help="A path to an executable (such as a script) " "which will be called before killing any tasks marked "