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 --disable-compression flag to kubectl #112580
Conversation
@shyamjvs: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
a04bbd9
to
aae720e
Compare
/test pull-kubernetes-e2e-kind-ipv6 |
test/cmd/get.sh
Outdated
# Commands to create 3 configmaps each of size 50KB. Sum of their sizes should be >128KB (defaultGzipThresholdBytes) | ||
# for apiserver to allow gzip compression of the response. This is required to test the disable-compression option | ||
# from client-side | ||
some_string=$(openssl rand -base64 50000) |
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.
nit: is there a way to get random content that doesn't require openssl? I'm not 100% sure that is accessible in all testing envs
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.
Good point and I had this same question. But looks like it's already used by some auth-related tests -
kubernetes/test/cmd/authentication.sh
Lines 57 to 61 in 19935de
### Provided --token should take precedence, thus not triggering the (invalid) exec credential plugin | |
# Pre-condition: Client certificate authentication enabled on the API server | |
kube::util::test_client_certificate_authentication_enabled | |
# Command | |
output=$(kubectl "${kube_flags_with_token[@]:?}" --kubeconfig="${TMPDIR:-/tmp}"/invalid_exec_plugin.yaml get namespace kube-system -o name || true) |
And we check there that openssl should be installed - https://github.com/kubernetes/kubernetes/blob/master/hack/lib/util.sh#L474
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.
something like dd status=none if=/dev/random bs=1K count=50 | base64
might still be lighter weight
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.
Done, thanks for the lead.
Also I used /dev/urandom
instead of /dev/random
as it seems like reading the latter could be a blocking operation on some OS and output of the former suffices our purpose - https://stackoverflow.com/questions/23712581/differences-between-random-and-urandom
aae720e
to
b31301f
Compare
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, shyamjvs 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 |
For the release note, I recommend this text: A new `--disable-compression` flag has been added to kubectl (default value is `false`). When `true`, kubectl opts out of response compression for all requests to the API server. This can help improve list call latencies significantly when client-server network bandwidth is ample (>30MB/s), or if the server is CPU-constrained. |
What this PR does / why we need it:
Follow-up of #112309, and part-3 of the proposal in #112296.
Does this PR introduce a user-facing change?
/sig cli
/kind feature
/assign @liggitt @seans3