-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for atomic multi-stage app deployments #20
Comments
Question 1: are the service ports for blue and green identical? If not, what port will a client application use to connect to an app? e.g. if blue port is 10101 and green port is 10102, how can a service, which depends on the blue/green service, connect to it? Question 2: How do we rollback? If I deploy green and blue is still alive and I notice that green is buggy, how do I rollback? |
Possible alternative to blue/green: we could deploy blue/green services as This doesn't solve any problem, it's just an alternative way of structuring the hierarchy of marathon app IDs. |
@markauskas IMHO, the question then would be of what service port to use. ideally I'd like to preserve the idea of letting Marathon maintain the service discovery ports, so mmsd doesn't introduce state. |
That is exactly my question. We either need to use one service port for all of these deployments and mmsd would only use the current deployment to configure haproxies, of we would need a global service port that would map to the service port of each deployment, but then we obviously would need to maintain this mapping somehow. |
Answer to Q1: Marathon is just proposing a (managed list) service discovery port. mmsd uses that information to expose this port on the load balancer. I thought (so far) it may be best to use the main app (not the linked app) mandates the service discovery ports. Answer to Q2: Rollback may be implemented in the (your) deploy app with a flip button (or rollback button) that flips between the 2 live versions. This flip action could then send a POST to mmsd to replace the backends with the other deployments backends of your app X. (open for discussion). Marathon's rollback equals redeploy within the same app. So that would take just too long compared to the proposal to answer Q2. |
Would the deploy tool need to send a request to every mmsd instance running on each hardware node? |
It seems to me that sending a request to mmsd would mean that mmsd needs to keep it's own state somehow. And it would not be possible to infer the desired state by just reading the currently configured apps in marathon. So if mmsd crashes, it needs to retrieve the state from marathon AND from somewhere else. |
WIP
GOALS:
Add support for atomic deploys while retaining support for rolling deploys.
DEFINITION: "Rolling Deploy"
Upon redeploying a application cluster, the new application instances (tasks) are spawned within the existing cluster. Once a new task becomes healthy an old task is being terminated, leaving the cluster with two versions during the deployment phase. Only when all tasks have been fully replaced with the new deployed version, the app cluster is not mixing up responses anymore.
DEFINITION: "Atomic Deploy"
An atomic deploy for a load balanced cluster is where the newly deployed tasks are activated in the load balancer (/service discovery) once all tasks became haealthy. The LB will then replace all old task's endpoints with the new endpoints while current sessions are still allowed to complete. Only after that the old deployment is subject to be terminated.
Motivation
In current deployments, we see somm 5xx HTTP response status codes due to the fact that we're having rolling deployments, and we hope to reduce them with the atomic switch from an old to the new app cluster version.
Implementation
By default, we consider each application to be a blue app. We can additionally link a green app to the blue app with an application label.
/production/frontend-webapp
with labelmmsd_atomic_deploy_suffix
set to-green
./production/frontend-webapp-green
Properties of Linked Applications
Notes
Now, when an application gets redeployed, mmsd is getting notified via the event bus by the time the deployment starts.
mmsd
will update its local state and fetch all applications metadata, including the newmmsd_atomic_deploy_suffix
and build an internal map of blue/green apps.deployment_success
,mmsd
will reconfigure the load balancer to point to the latest deployment (blue or green).Editorial Notes
The text was updated successfully, but these errors were encountered: