Skip to content

Commit 34b46e8

Browse files
authored
KEP-2885 Field Validation 1.27 GA graduation (#3725)
* Update field validation KEP for 1.27 GA graduation * Address feedback * update gate removal timeline
1 parent c28f8a5 commit 34b46e8

File tree

3 files changed

+58
-34
lines changed

3 files changed

+58
-34
lines changed

keps/prod-readiness/sig-api-machinery/2885.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ alpha:
33
approver: "@deads2k"
44
beta:
55
approver: "@deads2k"
6+
stable:
7+
approver: "@deads2k"

keps/sig-api-machinery/2885-server-side-unknown-field-validation/README.md

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ tags, and then generate with `hack/update-toc.sh`.
105105
- [Graduation Criteria](#graduation-criteria)
106106
- [Alpha](#alpha)
107107
- [Beta](#beta)
108+
- [GA](#ga)
109+
- [Version Skew Strategy](#version-skew-strategy)
108110
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
109111
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
110112
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
@@ -313,11 +315,12 @@ client-side validation, albeit one that is error-prone and not officially
313315
supported).
314316

315317
Long-term, we want to favor using out-of-tree solutions for client-side
316-
validation, though this idea is still in its infancy.
318+
validation. The [kubeconform](https://github.com/yannh/kubeconform) project is an example of an out-of-tree solution that does this.
317319

318-
The [kubeval](https://www.kubeval.com/) project is an example of an out-of-tree solution that does this, and
319-
we will look into expanding its support of open API to v3, and investigate
320-
whether it makes sense as a permanent solution to client-side validation.
320+
SIG API Machinery's effort will go to producing clear and complete (and
321+
improving over time) API spec documents insteading of making client side
322+
validation. We strongly recommend that third part integrators make use of such
323+
documents.
321324

322325
##### Aligning json and yaml errors
323326

@@ -615,6 +618,11 @@ It tests the cross product of all valid permutations along the dimensions of:
615618
With field validation on by default in beta, we will modify
616619
[test/e2e/kubectl/kubectl.go](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/kubectl/kubectl.go) to ensure that kubectl defaults to using server side field validation and detects unknown/duplicate fields as expected.
617620

621+
[GA]
622+
We will introduce field validation specific e2e/conformance tests to submit
623+
requests directly against the API server for both built-in and custom resources
624+
to test that duplicate and unknown fields are appropriately detected.
625+
618626
### Graduation Criteria
619627
<!--
620628
**Note:** *Not required until targeted at a release.*
@@ -655,29 +663,23 @@ Below are some examples to consider, in addition to the aforementioned [maturity
655663
- [x] field validation integration tests check for exact match of strict errors
656664
- [x] In tree NestedObjectDecoders no longer short circuit on strict decoding
657665
errors [#107545](https://github.com/kubernetes/kubernetes/issues/107545)
658-
- [ ] Unknown/Duplicate fields are properly detected in the metadata at both the
666+
- [x] Unknown/Duplicate fields are properly detected in the metadata at both the
659667
root level and within embedded objects
660668
[#109215](https://github.com/kubernetes/kubernetes/issues/109215),[#109316](https://github.com/kubernetes/kubernetes/pull/109316), and
661669
[#109494](https://github.com/kubernetes/kubernetes/pull/109494)
662670

663671

664-
<!--
665672
#### GA
666673

667-
- N examples of real-world usage
668-
- N installs
669-
- More rigorous forms of testing—e.g., downgrade tests and scalability tests
670-
- Allowing time for feedback
671-
672-
**Note:** Generally we also wait at least two releases between beta and
673-
GA/stable, because there's no opportunity for user feedback, or even bug reports,
674-
in back-to-back releases.
675-
676-
**For non-optional features moving to GA, the graduation criteria must include
677-
[conformance tests].**
678-
679-
[conformance tests]: https://git.k8s.io/community/contributors/devel/sig-architecture/conformance-tests.md
674+
- [x] Wait two releases (1.25 and 1.26) with field validation enabled by default
675+
and receive minimal bug reports pertaining to the feature. As a data point,
676+
GKE clusters running field validation by default in 1.25 are seeing less CPU
677+
and memory overall vs 1.24, supporting the notion that this feature has not
678+
significantly impacted performance.
679+
- [] Add conformance testing to invoke field validation directly
680+
against the API server
680681

682+
<!--
681683
#### Deprecation
682684
683685
- Announce deprecation and support policy of the existing flag
@@ -696,20 +698,30 @@ enhancement:
696698
cluster required to make on upgrade, in order to maintain previous behavior?
697699
- What changes (in invocations, configurations, API use, etc.) is an existing
698700
cluster required to make on upgrade, in order to make use of the enhancement?
701+
-->
699702

700703
### Version Skew Strategy
701704

702-
If applicable, how will the component handle version skew with other
703-
components? What are the guarantees? Make sure this is in the test plan.
705+
Following the graduation of server-side field validation to GA, there will be a
706+
period of time when a newer client (which expects server-side field validation locked in GA) will send
707+
requests to an older server that could have server-side field validation
708+
disabled.
704709

705-
Consider the following in developing a version skew strategy for this
706-
enhancement:
707-
- Does this enhancement involve coordinating behavior in the control plane and
708-
in the kubelet? How does an n-2 kubelet without this feature available behave
709-
when this feature is used?
710-
- Will any other components on the node change? For example, changes to CSI,
711-
CRI or CNI may require updating that component before the kubelet.
712-
-->
710+
Until version skew makes it incompatible for a client to hit a server
711+
with field validation disabled, kubectl must continue to check if the feature is
712+
enabled server-side. As long as the feature can be disabled server-side, kubectl
713+
must continue to have client-side validation. When the feature can't be disabled
714+
server-side, kubectl should remove client-side validation entirely.
715+
716+
Given that kubectl [supports](https://kubernetes.io/releases/version-skew-policy/#kubectl) one minor version skew (older or newer) of kube-apipserver,
717+
this would mean that removing client-side validation in 1.28 would be
718+
1-version-skew-compatible with GA in 1.27 (when server-side validation can no
719+
longer be disabled).
720+
721+
See section on [Out-of-Tree
722+
Alternatives to Client Side
723+
Validation](#out-of-tree-alternatives-to-client-side-validation) for
724+
alternatives to client-side validation
713725

714726
## Production Readiness Review Questionnaire
715727

@@ -749,6 +761,8 @@ Pick one of these and delete the rest.
749761
- [x] Feature gate (also fill in values in `kep.yaml`)
750762
- Feature gate name: ServerSideFieldValidation
751763
- Components depending on the feature gate: kube-apiserver
764+
- Note: feature gate locked to true upon graduation to GA (1.27) and removed
765+
two releases later (1.29)
752766
- [x] Other
753767
- Describe the mechanism: query parameter
754768
- Will enabling / disabling the feature require downtime of the control
@@ -851,8 +865,15 @@ Recall that end users cannot usually observe component logs or access metrics.
851865

852866
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
853867

854-
Users should expect to see an increase in request latency and memory usage
855-
(~20-25% increase) for requests that desire server side schema validation.
868+
We have benchmark tests for field validation
869+
[here](https://github.com/kubernetes/kubernetes/blob/master/test/integration/apiserver/field_validation_test.go#L2936-L2996) and an analysis of those
870+
benchmarks summarized
871+
[here](https://github.com/kubernetes/kubernetes/pull/107848#issuecomment-1032216698).
872+
873+
Based on the above, users should should expect to see negligible latency increases (with the
874+
exception of SMP requests that are ~5% slower), and memory that is negligible
875+
for JSON (and no change for protobuf), but around 10-20% more memory usage for
876+
YAML data.
856877

857878
Cluster operators can also use cpu usage monitoring to determine whether
858879
increased usage of server-side schema validation dramatically increases CPU usage after feature enablement.

keps/sig-api-machinery/2885-server-side-unknown-field-validation/kep.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,22 @@ see-also:
1818
replaces:
1919

2020
# The target maturity stage in the current dev cycle for this KEP.
21-
stage: beta
21+
stage: stable
2222

2323
# The most recent milestone for which work toward delivery of this KEP has been
2424
# done. This can be the current (upcoming) milestone, if it is being actively
2525
# worked on.
26-
latest-milestone: "v1.25"
26+
latest-milestone: "v1.27"
2727

2828
# The milestone at which this feature was, or is targeted to be, at each stage.
2929
milestone:
3030
alpha: "v1.23"
3131
beta: "v1.25"
32-
stable: "v1.26"
32+
stable: "v1.27"
3333

3434
# The following PRR answers are required at alpha release
3535
# List the feature gate name and the components for which it must be enabled
36+
# Note: feature-gate removed upon graduation to GA in 1.27
3637
feature-gates:
3738
- name: ServerSideFieldValidation
3839
components:

0 commit comments

Comments
 (0)