How to update your application in Cloud Foundry without dropping user requests..

  • Download Gist
Cloud Foundry Production Updates
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
# vmc update is great for test and development, however it stops your old app and stages and starts the new one,
# resulting in dropped requests.
# If you want to update an application without dropping user requests, see below.
# NOTE: This change assumes your application can share services, etc with the new version.
# Assume my app is named foo
vmc push foo-v2 --url
# New app is running under a different url that can be tested independently.
vmc map foo-v2
# New app and old app are now fielding traffic to
vmc instances foo-v2 N
# Scale up if needed.
vmc instances foo 1
# Scale old app down
vmc unmap foo
# New app is fielding all traffic at this point
# if you need to rollback.
vmc map foo
vmc unmap foo-v2
# Now you can stop or delete the old version
vmc stop foo
# I leave these around, in a stopped state with no urls, but bound to any services needed. This way I can put new bits into this app's namespace with vmc update foo

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.