Skip to content
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-5116: Add KEP (Streaming response encoding) #5119

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

serathius
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 31, 2025
@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 31, 2025
@deads2k
Copy link
Contributor

deads2k commented Jan 31, 2025

@benluddy can you ptal?

@serathius serathius force-pushed the kep-5116 branch 3 times, most recently from 05be44a to 7267cf4 Compare February 3, 2025 13:04
@serathius
Copy link
Contributor Author

/assign @jpbetz

@serathius serathius force-pushed the kep-5116 branch 2 times, most recently from 032c3d0 to 8b5656f Compare February 3, 2025 18:40
@serathius serathius force-pushed the kep-5116 branch 3 times, most recently from 2c8682a to 80a5cb2 Compare February 5, 2025 10:21
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Here's a bunch of feedback.

Key points:

  • let's be clear about the status of YAML and that streaming encoding to YAML won't be available
    • (does using legacy encoding to YAML provide a route for a malicious client to overload API server memory)?
  • formally, the response to a list is a collection
  • we style list in lower case bold in docs, and I recommend doing that here too.

@sftim
Copy link
Contributor

sftim commented Feb 5, 2025

BTW if we want to ship JSON and ProtoBuf as beta for v1.33, I don't see anything stopping us doing that and still adding streaming YAML collections before we close the KEP as Done.

Comment on lines +153 to +155
Then, we will rewrite the gzip compression to buffer the response and delay the
decision to enable compression until we have observed enough bytes to hit the threshold
or we received whole response and we can write it without compressing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an implementation note, by adding an intermediate buffer to the gzip writer wrapper, be careful not to reintroduce the issue where we don't flush headers until a non-zero number of bytes are written

https://github.com/kubernetes/kubernetes/pull/31446/files#diff-67dd9e8f3ee257072765326cb4f242852554a2c0753563fa51e292c0a63a7b94R2488

maybe the code path that hits deferredResponseWriter isn't vulnerable to that issue if it already has the single object it is serializing, but watch out for buffering a generic gzip writer wrapper if we're not sure whether or not we'll have immediate output

@liggitt
Copy link
Member

liggitt commented Feb 5, 2025

a couple suggestions but lgtm overall

@serathius serathius force-pushed the kep-5116 branch 2 times, most recently from dfa1854 to fbcb030 Compare February 6, 2025 00:15
@liggitt
Copy link
Member

liggitt commented Feb 6, 2025

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 6, 2025
Copy link

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM(non-binding)!

Copy link
Member

@liggitt liggitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lgtm, will let @deads2k (for apimachinery) and @jpbetz (for PRR) have approval

@sftim
Copy link
Contributor

sftim commented Feb 10, 2025

/retitle KEP-5116: Add KEP (Streaming response encoding)

@k8s-ci-robot k8s-ci-robot changed the title Propose KEP-5116: Streaming response encoding KEP-5116: Add KEP (Streaming response encoding) Feb 10, 2025
@wojtek-t
Copy link
Member

this lgtm, will let @deads2k (for apimachinery) and @jpbetz (for PRR) have approval

I'm fine with this as well.

@deads2k @jpbetz - friendly ping for review

@benluddy
Copy link
Contributor

LGTM. Strictly constraining the supported types keeps the special-case implementation simple, and client behavior remains unchanged.

@deads2k
Copy link
Contributor

deads2k commented Feb 12, 2025

needs updates for PRR enable/disable and monitoring. The list of tests looks good. lgtm otherwise.

@serathius
Copy link
Contributor Author

needs updates for PRR enable/disable and monitoring. The list of tests looks good. lgtm otherwise.

Fixed, thanks for review!

@deads2k
Copy link
Contributor

deads2k commented Feb 13, 2025

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, fuweid, serathius

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 13, 2025
@k8s-ci-robot k8s-ci-robot merged commit 0eb98c7 into kubernetes:master Feb 13, 2025
4 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants