-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Add feature gating to REST Compression #46966
Add feature gating to REST Compression #46966
Conversation
Hi @ilackarms. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
pkg/features/kube_features.go
Outdated
// alpha: v1.7 | ||
// | ||
// Enables compression of REST responses (GET and LIST only) | ||
EnableRESTCompression utilfeature.Feature = "EnableRESTCompression" |
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.
don't prefix with "Enable", maybe something like APIResponseCompression
pkg/features/kube_features.go
Outdated
@@ -138,6 +144,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS | |||
RotateKubeletClientCertificate: {Default: false, PreRelease: utilfeature.Alpha}, | |||
PersistentLocalVolumes: {Default: false, PreRelease: utilfeature.Alpha}, | |||
LocalStorageCapacityIsolation: {Default: false, PreRelease: utilfeature.Alpha}, | |||
EnableRESTCompression: {Default: true, PreRelease: utilfeature.Alpha}, |
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'd consider it GA, it's enabled by default, it can just be disabled if needed
required if #45666 is going into 1.7 |
I'm ok with it being on by default but disable able in 1.7.
Needs to get into the release list.
…On Mon, Jun 5, 2017 at 10:49 AM, Jordan Liggitt ***@***.***> wrote:
required if #45666 <#45666>
is going into 1.7
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#46966 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p0GP84121usyxJyhmgd3xgmRpjlJks5sBBWSgaJpZM4NwDxl>
.
|
ab026df
to
ef49439
Compare
@@ -588,7 +590,9 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage rest.Storag | |||
handler = restfulGetResource(getter, exporter, reqScope) | |||
} | |||
handler = metrics.InstrumentRouteFunc(action.Verb, resource, subresource, handler) | |||
handler = genericfilters.RestfulWithCompression(handler, a.group.Context) | |||
if utilfeature.DefaultFeatureGate.Enabled(features.APIResponseCompression) { |
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.
Not here. Please plumb as an arg to this method and plumb it back out. You can set the feature flag as a value on the apiserver/pkg/server/config
ef49439
to
7122dec
Compare
7122dec
to
b3503b2
Compare
pkg/features/kube_features.go
Outdated
// alpha: v1.7 | ||
// | ||
// Enables compression of REST responses (GET and LIST only) | ||
APIResponseCompression utilfeature.Feature = "APIResponseCompression" |
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 is actually staging/src/k8s.io/apiserver/pkg/features/kube_features.go
. It seems unusual, but the gate is actually generic since your changes were generic.
@@ -160,6 +161,10 @@ type Config struct { | |||
// Predicate which is true for paths of long-running http requests | |||
LongRunningFunc apirequest.LongRunningRequestCheck | |||
|
|||
// APIResponseCompression indicates whether API Responses should support compression | |||
// if the client requests it via Accept-Encoding | |||
APIResponseCompression bool |
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.
Rename to EnableAPIResponseCompression
@@ -61,6 +61,7 @@ import ( | |||
"k8s.io/client-go/informers" | |||
restclient "k8s.io/client-go/rest" | |||
certutil "k8s.io/client-go/util/cert" | |||
featuregates "k8s.io/kubernetes/pkg/features" |
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 should cause you to fail a verify script.
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.
It's why you need a generic feature flag.
47b2152
to
40a473b
Compare
/retest |
@@ -53,4 +59,5 @@ func init() { | |||
var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureSpec{ | |||
StreamingProxyRedirects: {Default: true, PreRelease: utilfeature.Beta}, | |||
AdvancedAuditing: {Default: false, PreRelease: utilfeature.Alpha}, | |||
APIResponseCompression: {Default: false, PreRelease: utilfeature.GA}, |
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.
until we're sure we want this defaulting on, and as this is the first release it's included, I'd mark this Alpha...
gated and marked alpha, this LGTM. @deads2k? |
this feature is gated; disabled by default
40a473b
to
c305f72
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, ilackarms Associated issue: 46963 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 47883, 47179, 46966, 47982, 47945) |
Wrong milestone here. |
/milestone v1.8 |
@pacoxu: The provided milestone is not valid for this repository. Milestones in this repository: [ Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What this PR does / why we need it: Adds feature gating to opt out of REST API compression
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #46963Special notes for your reviewer: This PR is a fix / addendum to #45666
Release note: