Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Minor doc edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Jul 7, 2016
1 parent 683c44c commit f51ec71
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
19 changes: 4 additions & 15 deletions Longhelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down Expand Up @@ -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'`
Ex: `HAPROXY_0_VHOST = 'marathon.mesosphere.com,marathon'`



14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions zdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down

0 comments on commit f51ec71

Please sign in to comment.