-
Notifications
You must be signed in to change notification settings - Fork 188
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 encoding for core K8s APIs in external-attacher #585
Conversation
Welcome @tosi3k! |
Hi @tosi3k. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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-sigs/prow repository. |
/assign @msau42 |
/ok-to-test |
@tosi3k All the other Kubernetes components you linked have protobuf configurable, while your PR makes them hardcoded. Is there a case when a cluster admin or CSI driver vendor would need to switch back to JSON? |
The only case coming up to my mind is when someone would use CSI-related sidecars in a K8s cluster which doesn't have protobuf encoding supported. That theoretical case is not possible in practice, though, because CSI project is younger than protobuf support in K8s:
|
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, tosi3k 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
If not specified explicitly, JSON encoding is used by default when talking to kube-apiserver.
For core K8s API objects like Pods, Nodes, etc., we can use protobuf encoding which reduces CPU consumption related to (de)serialization, reduces overall latency of the API call, reduces memory footprint, reduces the amount of work performed by the GC and results in quicker propagation of objects to event handlers of shared informers.
Which issue(s) this PR fixes:
No issue is opened for that.
Special notes for your reviewer:
Standard system components of K8s default their serialization method to protobuf for some time already:
kube-scheduler
: linkkubelet
: linkkube-proxy
: linkkube-controller-manager
: link and method's contentsSome benchmarks comparing JSON vs. protobuf showcasing how the latter data format (de)serializes faster and uses less memory:
Does this PR introduce a user-facing change?: