4 ms·
I don't understand how to use this, maybe I am missing something. Following the example, it starts 4 replicas of a 'web' service. You can create a service by r
by kh_hk 2y ago
I don't understand how to use this, maybe I am missing something.
Following the example, it starts 4 replicas of a 'web' service. You can create a service by running a deploy to one of the replicas, let's say example-web-1. What does the other 3 replicas do?
Now, let's say I update 'web'. Let's assume I want to do a zero-downtime deployment. That means I should be able to run a build command on the 'web' service, start this service somehow (maybe by adding an extra replica), and then run a deploy against the new target?
If I run a `docker compose up --build --force-recreate web` this will bring down the old replica, turning everything moot.
Instructions unclear, can anyone chime in and help me understand?
- thelastparadise 2y agoWhy would I not just do k8s rollout restart deployment? Or just switch my DNS or router between two backends?
- jgalt212 2y agoYou still need some warm-up routine to run for the newly online server before the hand-off occurs. I'm not a k8s expert, but the above described events can be easily handled by a bash or fab script.
- ahoka 2y agoWhat events do you mean? If the app needs a warm up, then it can use its readiness probe to ask for some delay until it gets request routed to it.
- jgalt212 2y agoGET requests to pages that fill caches or those that make apache start up more than n processes.
- thelastparadise 2y agoThis is a health/readiness probe in k8s. It's already solved quite solidly.
- joeatwork 2y agoI think this is part of a lighter weight Kubernetes alternative.
- ozgune 2y agoI think the parent project, Kamal, positions itself as a simpler alternative to K8s when deploying web apps. They have a question on this on their website: https://kamal-deploy.org https://kamal-deploy.org "Why not just run Capistrano, Kubernetes or Docker Swarm? ... Docker Swarm is much simpler than Kubernetes, but it’s still built on the same declarative model that uses state reconciliation. Kamal is intentionally designed around imperative commands, like Capistrano. Ultimately, there are a myriad of ways to deploy web apps, but this is the toolkit we’ve used at 37signals to bring HEY and all our other formerly cloud-hosted applications home to our own hardware."
- sisk 2y agoFor the first part of your question about the other replicas, docker will load balance between all of the replicas either with a VIP or by returning multiple IPs in the DNS request[0]. I didn't check if this proxy balances across multiple records returned in a DNS request but, at least in the case of VIP-based load balancing, should work like you would expect. For the second part about updating the service, I'm a little less clear. I guess the expectation would be to bring up a differently-named service within the same network, and then `kamal-proxy deploy` it? So maybe the expectation is for service names to include a version number? Keeping the old version hot makes sense if you want to quickly be able to route back to it. [0]: https://docs.docker.com/reference/compose-file/deploy/#endpoint_mode https://docs.docker.com/reference/compose-file/deploy/#endpo...
- deleted 2y ago[deleted]