-
Notifications
You must be signed in to change notification settings - Fork 0
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
Some changes #1
Some changes #1
Conversation
jennybuckley
commented
Mar 12, 2019
@@ -319,21 +319,24 @@ Some values of an object are typically generated before the object is persisted. | |||
|
|||
## Server Side Apply | |||
|
|||
Server Side Apply (SSA) is offering an apply path on the apiserver side of kubernetes instead of the previous/current Client Side Apply (CSA) that happens in kubectl. | |||
{{< feature-state for_k8s_version="v1.14" state="alpha" >}} In vesion 1.14, if the Server Side Apply feature is enabled, The `PATCH` endpoint will accept the additional `application/apply-patch+yaml` content type. Server Side Apply allows clients other than kubectl to perform the Apply operation, and will eventually fully replace the complicated Client Side Apply logic that only exists in kubectl. |
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.
In vesion 1.14
:-)
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 find it surprising that this section starts with a super technical explanation? Should we at least introduce somehow?
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.
Server Side Apply allows clients other than kubectl to perform the Apply operation, and will eventually fully replace the complicated Client Side Apply logic that only exists in kubectl.
Maybe a variation of this sentence should go first?
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.
Sure I agree.
|
||
*Note:* This is an alpha feature and needs to be enabled by setting the related (Feature Gate)[docs/reference/command-line-tools-reference/feature-gates.md]. | ||
Compared to the `last-applied` annotation managed by `kubectl`, Server Side Apply uses a more declarative approach, which tracks a user's field management, rather than a user's last applied state. This means that as a side effect of using Server Side Apply, information about which field manager manages each field in an object becomes available. |
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 don't know if I'd compare it directly to what we had before? Though it might be useful for some people
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.
Assuming we start the section with
Server Side Apply allows clients other than kubectl to perform the Apply operation, and will eventually fully replace the complicated Client Side Apply logic that only exists in kubectl.
then it makes sense to me to say how our approach is conceptually different
A conflict is a special status error that occurs when an `Apply` operation tries to change a field, which another user also claims to manage. | ||
A conflict is a special status error that occurs when an `Apply` operation tries to change a field, which another user also claims to manage. This will prevent an applier from unintentionally overwriting the value set by another user. When this occurs, the applier has 3 options to resolve the conflicts: | ||
|
||
* If overwriting the value was intentional (or if the applier is an automated process like a controller) the applier should set the `force` query parameter to true and make the request again. This will force the operation to succeed and the field will be removed all other field managers that claimed to manage it. |
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 not completely sure what's going to happen when you say "This will force the operation to succeed and the field will be removed all other field managers that claimed to manage it."
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.
Ah yeah, that is kind of ambiguous
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.
Small typo, aside from that feel free to merge
|
||
#### Comparison with CSA | ||
When an user sends a partially specified object to the Server Side Apply endpoint, the server merges it with the live object favoring the value in the applied config if it is specified twice. If the set of items present in the applied config is not a superset of the items the applied by the same user last time, each missing item that is not managed by any other field manager is removed. |
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 items the applied by the same user last time,
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.
Do we need somewhere to explain that we support multiple versions, and that we convert objects across version to detect conflict?
|
||
#### Kubectl | ||
* **Overwrite value, become sole manager:** If overwriting the value was intentional (or if the applier is an automated process like a controller) the applier should set the `force` query parameter to true and make the request again. This will force the operation to succeed, change the value of the field, and remove the field from all other managers' entries in managedFields. |
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 really like this list
Not sure how far this should go for alpha, but I guess a deeper explanation on how it works internally would be good at some point. And I wanted to do examples in the respective Kubectl docs. |
@kwiesmueller Thanks for reviewing, yes I think we should at some point include how maps, lists, atomic stuff, etc get treated when merging, openapi extensions this uses to make those decisions, maybe a high level description of exactly what happens from when a user makes an apply request to when they get a response, and maybe a description of the format of metav1.Fields like the one in types.go. Not sure how many of these we need for alpha docs. And we definitely need kubectl examples as well, but I think they don't belong in this api documentation (I could also be wrong). Also I don't think I have permission to merge this, since it's to your fork of the website repo. |
I sent you both invites to my fork @jennybuckley so it should be possible in theory. But merged anyways. Where do you think those examples should go? Isn't there a section in this repo for it? |