ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

Controller: Use Protocol Buffers for API access.

Open tosi3k opened this issue 10 months ago • 7 comments

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.

For CRDs, however, we still have to stick to JSON since they do not support protobuf encoding.

Standard system components of K8s default their serialization method to protobuf for some time already:

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] CVE Report (Scanner found CVE and adding report)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation only

Which issue/s this PR fixes

No issue is opened for that.

How Has This Been Tested?

Unit tests.

Checklist:

  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [x] I've read the CONTRIBUTION guide
  • [ ] I have added unit and/or e2e tests to cover my changes.
  • [x] All new and existing tests passed.

tosi3k avatar Dec 10 '24 11:12 tosi3k