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

Use protobuf for kubectl top #96655

Merged
merged 1 commit into from Mar 6, 2021

Conversation

serathius
Copy link
Contributor

@serathius serathius commented Nov 17, 2020

What type of PR is this?
/kind feature

What this PR does / why we need it:
Encoding JSON takes around 30% of CPU and 15% of memory used by Metrics Server. Switching to proto will allow large savings in resources needed for MS.

kubect: Added --use-protocol-buffers flag to kubectl top pods and nodes

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 17, 2020
@brianpursley
Copy link
Member

This seems like it would be ok, but we don't set content type anywhere else in kubectl currently. Maybe a topic for the next sig-cli meeting.

/cc @soltysh

@serathius
Copy link
Contributor Author

kubectl uses normally generic client that doesn't support proto. kubectl top is only exception that I know that it uses concrete client.

@serathius
Copy link
Contributor Author

serathius commented Jan 16, 2021

/sig cli
/priority important-soon

@soltysh
Copy link
Contributor

soltysh commented Jan 21, 2021

kubectl uses normally generic client that doesn't support proto. kubectl top is only exception that I know that it uses concrete client.

That's not necessarily true, we're not using generic client any more at least. Most commands create ad-hoc client which has all the necessary capabilities including support for proto, if needed.

@serathius what is the benefit for kubectl users behind this change?

@soltysh
Copy link
Contributor

soltysh commented Jan 21, 2021

This seems like it would be ok, but we don't set content type anywhere else in kubectl currently. Maybe a topic for the next sig-cli meeting.

Yeah, it's a good topic to have.

@serathius
Copy link
Contributor Author

@serathius what is the benefit for kubectl users behind this change?

Switching from JSON to proto allows Metrics Server to save around 30% of CPU and 15% of memory used. By saving on JSON encoding we plan to improve freshness of metrics, from 1 minute to 15 seconds. With this we both improve autoscaling quality and usefulness of kubectl top.

@dougsland
Copy link
Member

/cc

Copy link
Member

@dougsland dougsland left a comment

Choose a reason for hiding this comment

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

Note from SIG-CLI meeting:
This change will require a flag option in kubectl and a warning message that in the next release it will be enabled by default. Other than that people is exited about this change.

@soltysh @serathius please let me know if I missed anything.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels Feb 13, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2021
@serathius
Copy link
Contributor Author

/retest

2 similar comments
@serathius
Copy link
Contributor Author

/retest

@serathius
Copy link
Contributor Author

/retest

@serathius
Copy link
Contributor Author

ping @soltysh

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

/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 Mar 5, 2021
@soltysh
Copy link
Contributor

soltysh commented Mar 5, 2021

/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 5, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: serathius, soltysh

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 Mar 5, 2021
@serathius
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit a54414e into kubernetes:master Mar 6, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Mar 6, 2021
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. area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants