Skip to content

Commit c9c9ad5

Browse files
committed
OpenAPI V3 GA
1 parent f633d91 commit c9c9ad5

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

keps/prod-readiness/sig-api-machinery/2896.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/2896-openapi-v3/README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Architecture for cross-cutting KEPs). -->
6363
- [Proposal](#proposal)
6464
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
6565
- [Future Work](#future-work)
66+
- [OpenAPI V2 plan](#openapi-v2-plan)
6667
- [Risks and Mitigations](#risks-and-mitigations)
6768
- [Design Details](#design-details)
6869
- [Paths](#paths)
@@ -73,10 +74,12 @@ Architecture for cross-cutting KEPs). -->
7374
- [OpenAPI](#openapi)
7475
- [Version Skew](#version-skew)
7576
- [OpenAPI V3 Proto](#openapi-v3-proto)
77+
- [Clients](#clients)
7678
- [Test Plan](#test-plan)
7779
- [Graduation Criteria](#graduation-criteria)
7880
- [Alpha](#alpha)
7981
- [Beta](#beta)
82+
- [GA](#ga)
8083
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
8184
- [Version Skew Strategy](#version-skew-strategy)
8285
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
@@ -209,6 +212,17 @@ endpoints.
209212
After OpenAPI v3 is implemented, we can start working on updating clients to
210213
consume OpenAPI v3. A separate KEP will be published for that.
211214

215+
#### OpenAPI V2 plan
216+
217+
As OpenAPI V3 becomes more and more available and easily accessible,
218+
clients should move to OpenAPI V3 in favor of OpenAPI V2. This should
219+
result in a steady decline in the number of requests sent to the
220+
OpenAPI V2 endpoint. In the short term, we will make OpenAPI V2 make
221+
computations more lazily, deferring the aggregation and marshaling
222+
process to be on demand rather than at a set interval. This is not
223+
directly part of OpenAPI V3's GA plan, but is something we will be
224+
monitoring closely once OpenAPI V3 is GA.
225+
212226
### Risks and Mitigations
213227

214228
Aggregation for OpenAPI v2 already consumes a non-negligible amount of
@@ -277,6 +291,12 @@ updates. If there is a race and the client passes in an outdated etag
277291
value, the server will send a 301 to redirect the client to the URL
278292
with the latest etag value.
279293

294+
To ensure that the client cache does not grow in an unbounded manner,
295+
the client-go disk cache will be replaced with a cmopactable disk
296+
cache which performs occasional cleanup of old cached files. Refer to
297+
[PR](https://github.com/kubernetes/kubernetes/pull/109701) for more
298+
details.
299+
280300
### Controllers
281301

282302
#### OpenAPI Builder
@@ -383,6 +403,16 @@ This solves the immediate protobuf issue but adds complexity to the OpenAPI sche
383403

384404
The final alternative is to upgrade to OpenAPI 3.1 where the new JSON Schema version it is based off of supports fields alongside a `$ref`. However, OpenAPI does not follow semvar and 3.1 is a major upgrade over 3.0 and introduces various backwards incompatible changes. Furthermore, library support is currently lacking (gnostic) and doesn't fully support OpenAPI 3.1. One important backwards incompatible change is the removal of the nullable field and replacing it by changing the type field from a single string to an array of strings.
385405

406+
### Clients
407+
408+
Updating all OpenAPI V2 clients to use OpenAPI V3 is outside the scope
409+
of this KEP and part of future work. However, some key clients will be
410+
updated to use OpenAPI V3 as part of GA. One example is [OpenAPI V3
411+
for kubectl
412+
explain](https://github.com/kubernetes/enhancements/blob/master/keps/sig-cli/3515-kubectl-explain-openapiv3/README.md).
413+
Server Side Apply will also be updated to directly use the OpenAPI V3
414+
schema rather than OpenAPI V2. Finally, the query param verifier in
415+
kubectl will be updated to use OpenAPI V3.
386416

387417
### Test Plan
388418

@@ -407,6 +437,8 @@ For alpha, unit tests will be included to ensure that v3 schemas are properly
407437
generated and published. A validator will also be used to ensure that the spec
408438
generated is valid OpenAPI v3.
409439

440+
A fuzzer and performance benchmark tests will also be included.
441+
410442
### Graduation Criteria
411443

412444
#### Alpha
@@ -420,13 +452,20 @@ generated is valid OpenAPI v3.
420452
- Incorrect OpenAPI polymorphic types (IntOrString, Quantity) are updated to use `anyOf` in OpenAPI V3
421453
- Definition names of native resources are updated to omit their package paths
422454
- Parameters are reused as components
423-
- `kubectl explain` to support using the OpenAPI v3 Schema
424455
- Aggregated API servers are queried for their v2 endpoint and converted to
425456
publish v3 if they do not directly publish v3
426457
- Heuristics are used for the OpenAPI v2 to v3 conversion to maximize
427458
correctness of published spec
428459
- Aggregation for OpenAPI v3 will serve as a proxy to downstream OpenAPI paths
429460

461+
#### GA
462+
463+
- OpenAPI V3 uses the optimized JSON marshaler for increased performance. See [link](https://github.com/kubernetes/kube-openapi/pull/319) for the benefits with OpenAPI V2.
464+
- [Updated OpenAPI V3 Client Interface](https://docs.google.com/document/d/1HmqJH-yyK8WyU8V1y5z-RyMLq9-Xe8JfTTuaNkm9GZ0)
465+
- Direct conversion from OpenAPI V3 to SMD schema for Server Side Apply
466+
- HTTP Disk Cache is replaced with Compactable Disk Cache
467+
- Conformance tests
468+
430469
### Upgrade / Downgrade Strategy
431470

432471
<!-- If applicable, how will the component be upgraded and downgraded? Make sure

keps/sig-api-machinery/2896-openapi-v3/kep.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: KEP Template
1+
title: OpenAPI V3
22
kep-number: 2896
33
authors:
44
- "@jefftree"
@@ -14,17 +14,18 @@ approvers:
1414
- "@lavalamp"
1515

1616
# The target maturity stage in the current dev cycle for this KEP.
17-
stage: beta
17+
stage: stable
1818

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

2424
# The milestone at which this feature was, or is targeted to be, at each stage.
2525
milestone:
2626
alpha: "v1.23"
2727
beta: "v1.24"
28+
stable: "v1.27"
2829

2930
# The following PRR answers are required at alpha release
3031
# List the feature gate name and the components for which it must be enabled

0 commit comments

Comments
 (0)