You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution we previously discussed for this is to make the DeploymentConfigController responsible for reconciling a deployment's replica count with its associated config. The auto-scaler (or manual scaler) would target only the deploymentConfig. This allows the controller to safely decide whether to scale up now (if the latest deployment is complete) or later (after an in-progress deployment completes).
This does introduce a fundamental change in the way we've been presenting DC scaling to users. Today, the DC replicas is only for new deployments, and subsequent deployments follow the replica count of the last successful deployment. With this change, a user modification to the DC replicas would actually scale up the deployment. I think this is probably better behavior, and brings us closer to the semantics of the new upstream deployment system, but it does warrant discussion since the current behavior is documented and unchanged since the introduction of deployments.
So, AFAICT, the actual scaling action for our DeploymentConfig implementation occurs in the deployer pod (except for "cleanup failed deployment" part which happens in the deployer pod controller), which dies when the deployment is complete. Since this plan would require adding in another place that manipulates deployments, we have to be careful that we don't accidentally add in any more race conditions (my initial conclusion is that this shouldn't be a problem, but it's something to keep in mind).
(For comparison, the upstream Deployment implemention is controlled by the Deployment controller, as opposed to our DeploymentConfig setup, which has 3 controllers and the deployer pod).
The DeploymentConfigController might also need to take care of ensuring that deployments older than the latest complete deployment are scaled down to zero (to eventually correct mistaken scaleups concurrent with new deployment creation in an HA setup). I think that might close any remaining gaps, but I won't be surprised if somebody thinks of other issues... 😁
Can you document how this proposal differs/aligns with the upstream DC
today (specifically what upstream allows w.r.t. changes in scale, and what
the upstream controller will do to old RCs)
The DeploymentConfigController might also need to take care of ensuring
that deployments older than the latest complete deployment are scaled down
to zero (to eventually correct mistaken scaleups concurrent with new
deployment creation in an HA setup). I think that might close any remaining
gaps, but I won't be surprised if somebody thinks of other issues... [image:
😁]
—
Reply to this email directly or view it on GitHub #5597 (comment).
We'll also need to fix the CLI and console so they adjust the deploymentConfig.spec.replicas directly when RCs are owned by a deploymentConfig. cc @jwforres@spadgett
The scale subresource handling will also need updated to scale just the deploymentConfig. The CLI and console should use the subresource instead of manipulating the DC directly, I think.
The scale subresource handling will also need updated to scale just the
deploymentConfig. The CLI and console should use the subresource instead of
manipulating the DC directly, I think.
—
Reply to this email directly or view it on GitHub #5597 (comment).
Talking with @Kargakis I found a pretty big problem stemming from behavior I had forgotten about, which is failure handling/automatic "rollback". Given:
Deploy RC.version 1 (success)
Deploy RC.version 2 (success)
Deploy RC.version=3 (failed)
Openshift will:
Scale down RC.version=3 to 0
Scale up RC.version=2 to its previous replica count
This is a problem because now we have a discrepency that will be very complicated for the controllers to resolve: the "latest" deployment according to the DC is RC.version=3, but the "effective" deployment is RC.version=2. So now scaling operations are going to inadvertantly target RC.version=3 due to the DC version not matching the "effective" deployment version.
Here's how this works upstream:
Deploy RC state A (scales up completely, "success")
Deploy RC state B (scales up complete, "success")
Deploy RC state C (scale never achieved, condition is such that this needs rectified)
Although upstream has no auto-rectify behavior yet, when it does, it'll be very simple: the deployment will be updated to state B, and the controller will now identify the existing RC with state B as the "new" RC and all other RCs (including RC state C) as "old", scale up B and scale down A and C.
I think the way we're handling it in OpenShift has in hindsight has painted us into a corner due to the complexity introduced by the inconsistency of the DC.version and what's considered the effective RC. I think given our use of sequential version numbers, we probably should have done this instead:
Roll back the DC template to RC.version=2's template
Deploy RC.version=4
Thinking back on why we did it the current way, I think it was to avoid a new deployer process (@smarterclayton or @abhgupta might remember.). I think we might be better off just letting a new deployment happen than trying to deal with the idea of the active deployment being some arbitrary RC backwards in time.
Scale up RC.version=2 to its previous replica count
This is a problem because now we have a discrepency that will be very
complicated for the controllers to resolve: the "latest" deployment
according to the DC is RC.version=3, but the "effective" deployment is
RC.version=2. So now scaling operations are going to inadvertantly target
RC.version=3 due to the DC version not matching the "effective" deployment
version.
Here's how this works upstream:
Deploy RC state A (scales up completely, "success")
Deploy RC state B (scales up complete, "success")
Deploy RC state C (scale never achieved, condition is such that this
needs rectified)
Although upstream has no auto-rectify behavior yet, when it does, it'll be
very simple: the deployment will be updated to state B, and the controller
will now identify the existing RC with state B as the "new" RC and all
other RCs (including RC state C) as "old", scale up B and scale down A and
C.
I think the way we're handling it in OpenShift has in hindsight has painted
us into a corner due to the complexity introduced by the inconsistency of
the DC.version and what's considered the effective RC. I think given our
use of sequential version numbers, we probably should have done this
instead:
Roll back the DC template to RC.version=2's template
The scaling operations will target the DC, which is at version=3. Normally we'd then use that as the basis of finding the latest RC for scaling. But with the current model, we must now have a special case where we go look for the "latest successful deployment" which could be any version.
That might work, but my confidence level in covering all edge cases is pretty low at this very moment. There are so many places where we assume that the latest deployment at a point in time is the current DC.latestVersion.
If we have code that is assuming latest = active, we have a bigger problem.
The scaler sets the DC.
The deployment controller should be able to know that a scale event
happened and target the right RC (it's the controller for responsible for
knowing what the latest rc is) What am I missing?
The scaling operations will target the DC, which is at version=3. Normally
we'd then use that as the basis of finding the latest RC for scaling. But
with the current model, we must now have a special case where we go look
for the "latest successful deployment" which could be any version.
That might work, but my confidence level in covering all edge cases is
pretty low at this very moment. There are so many places where we assume
that the latest deployment at a point in time is the current
DC.latestVersion.
—
Reply to this email directly or view it on GitHub #5597 (comment).
The deployer pod controller is going to also be trying to scale RCs in parallel, competing with the deployment controller.
If we want to keep the current general failure handling behavior, I think the way we implement it needs reworked so that only the deployment config controller is responsible for scaling outside the deployment process.
The deployer pod controller is going to also be trying to scale RCs in
parallel, competing with the deployment controller.
The deployer has to back off, or the deployment pod controller has to know
the deployment pod is in progress.
If we want to keep the current general failure handling behavior, I think
the way we implement it needs reworked so that only the deployment config
controller is responsible for scaling outside the deployment process
I'm not convinced of this. The deployment controller owns RCs and has
final say on target scaling. When the deployment controller has given
control to the deployer pod, there is no ambiguity of that. The deployer
needs to wait until the deployer pod is complete, or update the pod target
annotation. You can always heal an rc that is not under active control.
What I mean is, the logic that's currently in the deployer pod controller needs moved into the deployment config controller so that the deployer pod controller is responsible only for looking at the outcome of a deployer pod and updating the deployment phase. The deployment config controller should be looking at the deployments it owns and making all the scaling decisions.
Yes. I had a quick discussion with Brian today about potentially not
having "failed" deployments per se. I still want it for custom deploy
strategies, but maybe for rolling we just always try, and have a condition
on the deployment config that says "hasn't reached terminal state in X
minutes, warning"
What I mean is, the logic that's currently in the deployer pod controller
needs moved into the deployment config controller so that the deployer pod
controller is responsible only for looking at the outcome of a deployer pod
and updating the deployment phase. The deployment config controller should
be looking at the deployments it owns and making all the scaling decisions.
—
Reply to this email directly or view it on GitHub #5597 (comment).
Activity
ironcladlou commentedon Nov 10, 2015
The solution we previously discussed for this is to make the DeploymentConfigController responsible for reconciling a deployment's replica count with its associated config. The auto-scaler (or manual scaler) would target only the deploymentConfig. This allows the controller to safely decide whether to scale up now (if the latest deployment is complete) or later (after an in-progress deployment completes).
This does introduce a fundamental change in the way we've been presenting DC scaling to users. Today, the DC replicas is only for new deployments, and subsequent deployments follow the replica count of the last successful deployment. With this change, a user modification to the DC replicas would actually scale up the deployment. I think this is probably better behavior, and brings us closer to the semantics of the new upstream deployment system, but it does warrant discussion since the current behavior is documented and unchanged since the introduction of deployments.
cc @smarterclayton @ncdc @Kargakis
0xmichalis commentedon Nov 10, 2015
I find this reasonable.
ncdc commentedon Nov 10, 2015
cc @danmcp @devop-mmcgrath @eparis
DirectXMan12 commentedon Nov 10, 2015
So, AFAICT, the actual scaling action for our DeploymentConfig implementation occurs in the deployer pod (except for "cleanup failed deployment" part which happens in the deployer pod controller), which dies when the deployment is complete. Since this plan would require adding in another place that manipulates deployments, we have to be careful that we don't accidentally add in any more race conditions (my initial conclusion is that this shouldn't be a problem, but it's something to keep in mind).
(For comparison, the upstream Deployment implemention is controlled by the Deployment controller, as opposed to our DeploymentConfig setup, which has 3 controllers and the deployer pod).
ironcladlou commentedon Nov 10, 2015
The DeploymentConfigController might also need to take care of ensuring that deployments older than the latest complete deployment are scaled down to zero (to eventually correct mistaken scaleups concurrent with new deployment creation in an HA setup). I think that might close any remaining gaps, but I won't be surprised if somebody thinks of other issues... 😁
ironcladlou commentedon Nov 10, 2015
Trello card: https://trello.com/c/CCv7OpxE
smarterclayton commentedon Nov 11, 2015
Can you document how this proposal differs/aligns with the upstream DC
today (specifically what upstream allows w.r.t. changes in scale, and what
the upstream controller will do to old RCs)
On Nov 10, 2015, at 11:18 AM, Dan Mace [email protected] wrote:
The DeploymentConfigController might also need to take care of ensuring
that deployments older than the latest complete deployment are scaled down
to zero (to eventually correct mistaken scaleups concurrent with new
deployment creation in an HA setup). I think that might close any remaining
gaps, but I won't be surprised if somebody thinks of other issues... [image:
😁]
—
Reply to this email directly or view it on GitHub
#5597 (comment).
1 remaining item
ironcladlou commentedon Nov 11, 2015
I outlined another upstream alignment wrt scaling here: #5597 (comment)
ironcladlou commentedon Nov 11, 2015
We'll also need to fix the CLI and console so they adjust the deploymentConfig.spec.replicas directly when RCs are owned by a deploymentConfig. cc @jwforres @spadgett
ironcladlou commentedon Nov 11, 2015
The scale subresource handling will also need updated to scale just the deploymentConfig. The CLI and console should use the subresource instead of manipulating the DC directly, I think.
jwforres commentedon Nov 11, 2015
I would prefer that, do you have an example of what we would post to the
scale subresource?
On Wed, Nov 11, 2015 at 11:21 AM, Dan Mace [email protected] wrote:
ironcladlou commentedon Nov 11, 2015
Talking with @Kargakis I found a pretty big problem stemming from behavior I had forgotten about, which is failure handling/automatic "rollback". Given:
Openshift will:
This is a problem because now we have a discrepency that will be very complicated for the controllers to resolve: the "latest" deployment according to the DC is RC.version=3, but the "effective" deployment is RC.version=2. So now scaling operations are going to inadvertantly target RC.version=3 due to the DC version not matching the "effective" deployment version.
Here's how this works upstream:
Although upstream has no auto-rectify behavior yet, when it does, it'll be very simple: the deployment will be updated to state B, and the controller will now identify the existing RC with state B as the "new" RC and all other RCs (including RC state C) as "old", scale up B and scale down A and C.
I think the way we're handling it in OpenShift has in hindsight has painted us into a corner due to the complexity introduced by the inconsistency of the DC.version and what's considered the effective RC. I think given our use of sequential version numbers, we probably should have done this instead:
Thinking back on why we did it the current way, I think it was to avoid a new deployer process (@smarterclayton or @abhgupta might remember.). I think we might be better off just letting a new deployment happen than trying to deal with the idea of the active deployment being some arbitrary RC backwards in time.
smarterclayton commentedon Nov 11, 2015
Why would scaling operations target 3?
On Nov 11, 2015, at 8:51 AM, Dan Mace [email protected] wrote:
Talking with @Kargakis https://github.com/kargakis I found a pretty big
problem stemming from behavior I had forgotten about, which is failure
handling/automatic "rollback". Given:
Openshift will:
This is a problem because now we have a discrepency that will be very
complicated for the controllers to resolve: the "latest" deployment
according to the DC is RC.version=3, but the "effective" deployment is
RC.version=2. So now scaling operations are going to inadvertantly target
RC.version=3 due to the DC version not matching the "effective" deployment
version.
Here's how this works upstream:
needs rectified)
Although upstream has no auto-rectify behavior yet, when it does, it'll be
very simple: the deployment will be updated to state B, and the controller
will now identify the existing RC with state B as the "new" RC and all
other RCs (including RC state C) as "old", scale up B and scale down A and
C.
I think the way we're handling it in OpenShift has in hindsight has painted
us into a corner due to the complexity introduced by the inconsistency of
the DC.version and what's considered the effective RC. I think given our
use of sequential version numbers, we probably should have done this
instead:
Thinking back on why we did it the current way, I think it was to avoid a
new deployer process (@smarterclayton https://github.com/smarterclayton
or @abhgupta https://github.com/abhgupta might remember.). I think we
might be better off just letting a new deployment happen than trying to
deal with the idea of the active deployment being some arbitrary RC
backwards in time.
—
Reply to this email directly or view it on GitHub
#5597 (comment).
ironcladlou commentedon Nov 11, 2015
The scaling operations will target the DC, which is at version=3. Normally we'd then use that as the basis of finding the latest RC for scaling. But with the current model, we must now have a special case where we go look for the "latest successful deployment" which could be any version.
That might work, but my confidence level in covering all edge cases is pretty low at this very moment. There are so many places where we assume that the latest deployment at a point in time is the current DC.latestVersion.
smarterclayton commentedon Nov 11, 2015
If we have code that is assuming latest = active, we have a bigger problem.
The scaler sets the DC.
The deployment controller should be able to know that a scale event
happened and target the right RC (it's the controller for responsible for
knowing what the latest rc is) What am I missing?
On Nov 11, 2015, at 8:57 AM, Dan Mace [email protected] wrote:
Why would scaling operations target 3?
The scaling operations will target the DC, which is at version=3. Normally
we'd then use that as the basis of finding the latest RC for scaling. But
with the current model, we must now have a special case where we go look
for the "latest successful deployment" which could be any version.
That might work, but my confidence level in covering all edge cases is
pretty low at this very moment. There are so many places where we assume
that the latest deployment at a point in time is the current
DC.latestVersion.
—
Reply to this email directly or view it on GitHub
#5597 (comment).
ironcladlou commentedon Nov 11, 2015
The deployer pod controller is going to also be trying to scale RCs in parallel, competing with the deployment controller.
If we want to keep the current general failure handling behavior, I think the way we implement it needs reworked so that only the deployment config controller is responsible for scaling outside the deployment process.
smarterclayton commentedon Nov 11, 2015
On Nov 11, 2015, at 9:16 AM, Dan Mace [email protected] wrote:
The deployer pod controller is going to also be trying to scale RCs in
parallel, competing with the deployment controller.
The deployer has to back off, or the deployment pod controller has to know
the deployment pod is in progress.
If we want to keep the current general failure handling behavior, I think
the way we implement it needs reworked so that only the deployment config
controller is responsible for scaling outside the deployment process
I'm not convinced of this. The deployment controller owns RCs and has
final say on target scaling. When the deployment controller has given
control to the deployer pod, there is no ambiguity of that. The deployer
needs to wait until the deployer pod is complete, or update the pod target
annotation. You can always heal an rc that is not under active control.
ironcladlou commentedon Nov 11, 2015
What I mean is, the logic that's currently in the deployer pod controller needs moved into the deployment config controller so that the deployer pod controller is responsible only for looking at the outcome of a deployer pod and updating the deployment phase. The deployment config controller should be looking at the deployments it owns and making all the scaling decisions.
smarterclayton commentedon Nov 11, 2015
Yes. I had a quick discussion with Brian today about potentially not
having "failed" deployments per se. I still want it for custom deploy
strategies, but maybe for rolling we just always try, and have a condition
on the deployment config that says "hasn't reached terminal state in X
minutes, warning"
On Nov 11, 2015, at 11:28 AM, Dan Mace [email protected] wrote:
What I mean is, the logic that's currently in the deployer pod controller
needs moved into the deployment config controller so that the deployer pod
controller is responsible only for looking at the outcome of a deployer pod
and updating the deployment phase. The deployment config controller should
be looking at the deployments it owns and making all the scaling decisions.
—
Reply to this email directly or view it on GitHub
#5597 (comment).