Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zero Downtime app deployment with CoreOS

Tags:

docker

coreos

I have a docker container that I want to deploy to a CoreOS cluster that has to download my app from a git repo.

Let's say the app container runs nginx / nodejs

How should I update it?

If i submit the container and start it, that works the first time. But the second time I'll have to stop/start the container with fleetctl then I'll obviously have downtime. Should I start up new containers that are derived from that container?

like image 595
Cameron A. Ellis Avatar asked May 06 '14 05:05

Cameron A. Ellis


2 Answers

Here's a complete walkthrough on exactly such a scenario:

http://coreos.com/blog/zero-downtime-frontend-deploys-vulcand.html

like image 50
Brian Redbeard Avatar answered Sep 21 '22 05:09

Brian Redbeard


Instead of pulling down your application from github inside your container, you should bake your application code inside your container/image. Your container should start its services within a few seconds. To achieve zero downtime you should keep the old container running until your new container has started and is ready to accept new connections. You could do this by separating nginx into its own container and keep it running all the time.

like image 44
jkingyens Avatar answered Sep 20 '22 05:09

jkingyens