-
Notifications
You must be signed in to change notification settings - Fork 359
Fun with Deployments and Zero Downtime (ZDT)
-
To deploy ZDT:
upload_capi_release && ~/workspace/capi-release/scripts/deploy -o ~/workspace/capi-ci/cf-deployment-operations/temporary/add-deployment-updater.yml
Process 'cc_deployment_updater' running . -- lives on the scheduler vm
-
It's invoked from
/var/vcap/jobs/cc_deployment_updater/bin/cc_deployment_updater
by runningrake deployment_updater:start
and this starts a loop that sleeps forcc.deployment_updater.update_frequency_in_seconds
(default 5) and then runs one orchestration step on all active deployments (e.g. ones in stateDEPLOYING
).
-
First,
cf v3-push -i N
an app (likedora
with N maybe 4 or 5) -
Modify the code in a simple way
-
Referring to How to Create an App Using V3 of the CC API:
CF_API_ENDPOINT=$(cf api | grep -i "api endpoint" | awk '{print $3}') APP_GUID=$(cf v3-app dora --guid 2>/dev/null)` PACKAGE_GUID=$(cf curl /v3/packages -X POST -d "$(printf '{"type":"bits", "relationships": {"app": {"data": {"guid": "%s"}}}}' "$APP_GUID")" | tee /dev/tty | jq -r .guid) zip -r my-app-v2.zip * # ( -x *.zip if there are old zip files hanging around) curl -k "$CF_API_ENDPOINT/v3/packages/$PACKAGE_GUID/upload" -F bits=@"my-app.zip" -H "Authorization: $(cf oauth-token | grep bearer)" BUILD_GUID=$(cf curl /v3/builds -X POST -d "$(printf '{ "package": { "guid": "%s" }}' "$PACKAGE_GUID")" | tee /dev/tty | jq -r .guid) watch cf curl /v3/builds/$BUILD_GUID # stop when it's STAGED or FAILED DROPLET_GUID=$(cf curl /v3/builds/$BUILD_GUID | jq -r '.droplet.guid') cf curl /v3/apps/$APP_GUID/relationships/current_droplet -X PATCH -d "$(printf '{"data": {"guid": "%s"}}' "$DROPLET_GUID")"
-
Finally, create a deployment for the app with the new droplet:
cf curl /v3/apps/deployments -d "$(printf '{ "relationships":{ "app": { "data": { "guid": "%s" }}}' $APP_GUID)"
-
Repeatedly hit the app and verify that the output contains an ever-increasing proportion of the new output until the old output completely disappears and the webish process instances increase and then drop away.
-
Pipelines
-
Contributing
- Tips and Tricks
- Cloud Controller API v3 Style Guide
- Playbooks
- Development configuration
- Testing
-
Architectural Details
-
CC Resources
- Apps
- Audit Events
- Deployments
- Labels
- Services
- Sidecars
-
Dependencies
-
Troubleshooting
- Ruby Console Script to Find Fields that Cannot Be Decrypted
- Logging database queries in unit tests
- Inspecting blobstore cc resources and cc packages(webdav)
- How to Use USR1 Trap for Diagnostics
- How to Perf: Finding and Fixing Bottlenecks
- How to get access to mysql database
- How To Get a Ruby Heap Dumps & GC Stats from CC
- How to curl v4 internal endpoints with mtls
- How to access Bosh Director console and restore an outdated Cloud Config
- Analyzing Cloud Controller's NGINX logs using the toplogs script
-
k8s
-
Archive