-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
KEP-5051: Add Server Side Apply: Unsetting Fields KEP #5052
base: master
Are you sure you want to change the base?
KEP-5051: Add Server Side Apply: Unsetting Fields KEP #5052
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpbetz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
5380c70
to
a671fb0
Compare
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/kep.yaml
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
/retitle KEP-5051: Add Server Side Apply: Unsetting Fields KEP |
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
Maybe |
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
- MutatingAdmissionPolicy (Alpha feature) will be modified to always allow unset field markers. | ||
The use of unset field markers will NOT be feature gated in this alpha feature. |
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.
Though it is stated above that MutatingAdmissionPolicy won't graduate to Beta before UnsettingField, would it still introduce some risk that falsely allowing unset field markers when UnsettingField feature is disabled?
And, OOC, is it normal to handle relation between features like this(have a graduate dependency)?
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.
Though it is stated above that MutatingAdmissionPolicy won't graduate to Beta before UnsettingField, would it still introduce some risk that falsely allowing unset field markers when UnsettingField feature is disabled?
We intend to unconditionally allow MutatingAdmissionPolicy to use unsetting fields markers when the MutatingAdmissionPolicy feature gate is enabled. The graduation restriction is purely to ensure that the unsetting fields is not being by a feature that claims a stability level above the stability that we claim unsetting fields is at.
While we could configure MutatingAdmissionPolicy to not support unsetting fields unless both the MutatingAdmissionPolicy and UnsettingField feature gates are enabled, we don't really need to. What we're effectively doing is saying "MutatingAdmissionPolicy has unsetting field support. We making it an intrinsic part of the feature in alpha. Can we guard against any risk this might cause by restricting MutatingAdmissionPolicy promotion to not progress beyond UnsettingField"
And, OOC, is it normal to handle relation between features like this(have a graduate dependency)?
Yes, we've go graduation dependencies between other KEPs. It's not uncommon.
For manifests, I'm not 100% decided. I'm leaning toward not allowing For apply configurations we do want to allow users to put |
Thanks @sftim @aaron-prindle @yongruilin! Feedback applied |
I think that's fine, but maybe we want to feature-gate |
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.
Some nits
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
The big question in my mind is still: Because apparently manifests can't have field unset markers in but an apply configuration supplied to |
I don't think it's as bad as it might look at first glance. Using a fully populated apply configuration (that could be also used as a manifest) that could be used to create a resource, together with But if we do end up needing something. I don't think we're completely painted into a corner. We could teach |
Co-authored-by: Tim Bannister <[email protected]> Co-authored-by: Yongrui Lin <[email protected]>
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
I agree. I'll track this in the beta graduation criteria section. |
Co-authored-by: Dr. Stefan Schimanski <[email protected]>
21d4837
to
684f57f
Compare
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
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.
Some questions. One potentially significant. I think the rest are easy.
|
||
```yaml | ||
spec: | ||
field: {k8s_io__value: unset} |
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.
when encoded in JSON or CBOR, this will be a string containing this? Actually what format is this? it's not quite JSON.
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.
This looks like YAML to me. I think the JSON would be something like:
"spec": {
"field": {
"k8s_io__value": "unset"
},
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.
That's right. I could switch this example to be more idiomatic YAML if that helps:
spec:
field:
k8s_io__value: unset
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.
This looks like YAML to me. I think the JSON would be something like:
Oh, my eye didn't read it that way. That means that it is logically impossible to escape the value for a piece of say integer configuration exposed from one resource to set a value in another. For instance, a controller of deployments would be unable to express "must be empty" in its API.
That seems really problematic.
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
- It's hard to imagine where escaping this key would actually be needed. If we really need the ability | ||
to "apply to an apply configuration" in the future, look into options, but building this without | ||
a plausible use case does not seem necessary. |
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.
An API that sets a value in another API seems like a natural thing to want. This happens when stacking configuration APIs for instance
- configuration API for operator/A has field/X
- operator/A is wrapped by operator/B along with others to act as a unit
- operator/B must expose a way to configure the value of field/X and does so in field/Y
- For a user to express "affirmatively unset field/X", they need to set field/Y to the string value
"{k8s_io__value: unset}"
Perhaps there's another way to accomplish 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.
Unescaping __k8s_io__value
to k8s_io__value
might not be that bad in the current implementation. Okay if I make this a beta graduation criteria? (It seems valuable for production grade but not essential for proving the idea at the alpha level?)
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.
Unescaping
__k8s_io__value
tok8s_io__value
might not be that bad in the current implementation. Okay if I make this a beta graduation criteria? (It seems valuable for production grade but not essential for proving the idea at the alpha level?)
Must be present before going beta, but yes I think we could try alpha without 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've almost got it working, I'll target this for the 1st alpha, possibly as a separate PR.
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Show resolved
Hide resolved
keps/sig-api-machinery/5051-server-side-apply-unsetting-fields/README.md
Outdated
Show resolved
Hide resolved
PRR looks good, concept seems ok, but I'm struggling with whether the escaping can work for scalar values like string or int when embedding one schema in another. I think it might not be possible and I'm torn as to whether that makes the feature inconsistent enough to avoid doing it. Taking a more concrete example, maybe something like a crd/MultiDeploymentManager that has slice .spec.deploymentTemplates DeploymentSpec. A controller reads the .spec.deploymentTemplates and applies the deployments. For some reason, the author wants to express, "multiDeploymentManager/foo's |
EDIT: See |
An alternative to using a marker as a substitute for values would be to use a field name prefix. So if the fields is "replicas", then setting "(marker-prefix)_replicas" would unset the field. For list maps, a field insider the entry would need to be used. This would be slightly less painful to use in CRDs because all fields have a single, well defined type. If this is more acceptable I could go that way. Problem is that I'm unwell at the moment so I don't know if I can get a KEP update by Thursday. EDIT: cc @sttts |
We're going to hold on this. Mutating Admission Policy can proceed without unsetting in the SSA section (we will continue to have the jsonpatch capability). Since we must be compatible with existing manifests, adding this capability afterwards will mean we keep cruft (the jsonpatch deletion), but we can actually add it. For future-us, the embeddability discussion is where this got stuck. Whether it's possible and whether it's necessary |
KEP for #5051
This would fix a gap in Server Side Apply functionality that we have been aware of since Server Side Apply became GA.