Tutum Zero Downtime Re-deploy
I tweeted Tutum last night asking if they're looking at implementing zero downtime re-deploys for a given service. Slightly surprised by their response as it seems like a critical feature if you want to use the service for a production environment.
"not a top priority, but by Spring :)"
As Tutum currently doesn't support graceful termination of containers within a service, I was experiencing a 5-10 second window of 503
errors, so decided to use the following hack (code below) until the feature is officially implemented.
- Create two identical web app services.
- Link HAProxy service to both.
- Redeploy one service successfully.
- Wait 10 seconds.
- Redeploy the second service.
Note - use Tutum's HAProxy image so that it re-configures to new containers, and set the POLLING_PERIOD
environment variable to 1
.
- Could instead have a single service and redeploy the individual containers.
- The code could be better, would be better in a Thor app.
- Tutum is awesome!
Yes, default. In the future we may allow for different redeployment strategies, but for now this is the default. It's also much faster now thanks to our dynamic linking + overlay networking (more info coming soon). We finally kissed goodbye to ambassadors.
Try it out and let us know any issues. There may be some hiccups if the app (inside the container) takes more than a handful of seconds to be ready after container starts.
Thanks for feedback and support during our Beta!