-
Notifications
You must be signed in to change notification settings - Fork 80
design: one pager component mutable and versioning mechanism for OAM #29
Conversation
Can you share an example how to do blue-green deployment? |
Actually, I think it's hard to handle Blue-Green. I'm considering to build a workload upon the deployment. Workload revision represents different deployment. That means Blue-Green will build two deployments. In this way, do canary, blue-green upgrade will be much easier for deployment. |
Meanwhile since for the whole application upgrade, we need to update the component and applicationConfiguration both. For those two config file's changes, it's an async process. So we may generate two revision and trigger 2 times upgrade. How to handle this case? |
@henrywangx You can think of a OAM application is composed by two parts:
Here is an essential difference between they two: modifying
For history of operations, the system doesn't care it too much, because even you want to rollback an operation, it's in practical nothing but a re-deploy with new operation policy (this policy is same with a previous operation policy, but the system doesn't care). That being said, you can record the history of operations for audit etc. |
@resouer Yes I understand And About the Blue-Green upgrade, I guess @hongchaodeng is talking about how a k8s's deployment do the Blue-Green upgrade. From my knowledge, it's really hard to achieve the Blue-Green upgrade for deployment. So I give a solution:
|
@henrywangx Note that OAM creates its own revision object, it doesn't care revisions generated by Deployment controller. So there's no difference between modifying replicas and patching env list in OAM - both of them will not generate new revision.
I believe Hongchao is talking exactly same idea you are thinking. In OAM, you don't need to create a special workload for that:
so your Blue-green trait controller can always use @wonderflow , maybe code is better to illustrate the whole idea than Github comments 😄 |
@resouer thanks for explanation, but I think the proposal by @ryanzhang-oss could convince me better. There still are some confusion about the proposal, maybe I misunderstand about the idea by @wonderflow . And I will check the code to understand the design. |
After offline discuss with @wonderflow, I understood about the |
The "final" deployment's state can be always checked by Though I'm not sure if you get the point of the difference between Let's say you have a Deployment (replicas=10), and a HPA (min=1;max=100). And at Based your prevision suggestion, this scaling will trigger OAM system to create a "Component Revision (replicas=20)". My argument is this "Component Revision (replicas=20)" is actually useless. Because For example, what does it mean if we rollback to See? The essential difference here is There's another concept named snapshot. For example, you can snapshot all the objects of given Snapshot is not in the scope of OAM for now. |
@resouer I'm considering the change of That's why I don't like the paremeters, we have two input paths(component and parameter) to influence the final deployment's spec. |
blue-green example was added |
After deep consideration for some of your comments and trying to implement this proposal, I have updated something, please take a second review. Thanks very much. |
@henrywangx the encouraged usage of parameterValues is for parameter passing, for example: #24. It's an anti-pattern to use parameters to rollout the app (update image etc), we will clarify this clearly in the doc after component revision is implemented. |
@hasheddan @zzxwill Thanks so much for your review, I think we're all agree with I'm going to implement this proposal if there are no other different ideas. Hope we can merge it? \cc @negz @resouer @hongchaodeng @ryanzhang-oss @henrywangx |
Since component is becoming mutable, a very common question is how will the component versioning mechanism work. | ||
|
||
One of the requirement is the versioning mechanism should allow users to specify a fixed version of component | ||
in ApplicationConfiguration, so that the component can be upgraded as before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this requirement be re-examined instead? Does using Helm solve this problem adequately? Or do we think that version/revision tracking is fundamentally necessary for some of the upgrade features we want to add?
It seems complex understand that ApplicationConfiguration
both supports snapshotting (explicit versions everywhere) and automatic upgrade (no versions specified).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this requirement be re-examined instead? Does using Helm solve this problem adequately? Or do we think that version/revision tracking is fundamentally necessary for some of the upgrade features we want to add?
So the intention of having revision in OAM is to let Trait have a way to reference revisions when needed, for example, A/B testing trait and traffic splitting trait. AppConfig will not handle the upgrade story, it's only responsible for "emitting" correct revision of workload CR to k8s.
It seems complex understand that ApplicationConfiguration both supports snapshotting (explicit versions everywhere) and automatic upgrade (no versions specified).
Yes, though it should be implementable. This is a compromise that both scenarios are valid and widely used in the community.
@hasheddan made an interesting suggestion to introduce versioned components, where each version is immutable. That makes sense to me, as immutability to me simply means that a component config is unique to a name-version pair. An Application Configuration should always be specific about the version of a component that's being run. I think it would be a huge mistake to allow the equivalent of the "latest" tag for container images with Component instances. |
@vturecek This proposal is stick to have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
metadata: | ||
name: frontend-v0.0.1 # you could name this anything you wanted, but just appending the semver would be good practice | ||
spec: | ||
version: v0.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to explicitly claim a version
IMO. Revision object should be generated by the system, so it doesn't make lots sense to force the system generate version number incrementally like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine but what's the difference between controllerRevision with ComponentRevision if we remove this version field ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main difference is ControllerRevision
is not human readable as it uses a generic data
field to carry the revisioned object.
So if the argument is user experience, ComponentRevision
proposed in #29 (comment) is better - still, not a very big difference indeed.
While what I am not sure on Daniel is comment is:
but does not appear to be robust enough for a case like Component where an organization may want to "publish" multiple versions of a Component that will be consumed by multiple ApplicationConfigurations
I don't think it's the intention in this proposal. Revision is OAM is mostly for AppConfig/Trait controller to find workload CR by given revision number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good but with some missing parts. Comments left.
@hasheddan Finally I decide to use controllerRevision instead of creating a new concept |
@resouer @artursouza I think I have fixed all comments and already have an implementation(#35). Can we approve this proposal and let's move forward quickly? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks all for reviewing, the current design doc generally LGTM.
We will continue discussion of implementation details in #35
- "bash top" | ||
``` | ||
|
||
Now with `ControllerRevision` in place, let's talk about how to use it in Trait and ApplicationConfiguration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does Workload CR gets created in this case?
lgtm |
Signed-off-by: 天元 [email protected]
Coming from "OAM component versioning mechanism" and "The Component should mutable".
Since we discussed a lot and have a conclusion with OAM spec changes done. I write this proposal to make the implementation details more clear.