Skip to content

Use protobuf encoding for core K8s apis#676

Merged
mergify[bot] merged 1 commit into
csi-addons:mainfrom
Nikhil-Ladha:use-protobuf-encoding
Sep 20, 2024
Merged

Use protobuf encoding for core K8s apis#676
mergify[bot] merged 1 commit into
csi-addons:mainfrom
Nikhil-Ladha:use-protobuf-encoding

Conversation

@Nikhil-Ladha

Copy link
Copy Markdown
Contributor

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.

@black-dragon74

Copy link
Copy Markdown
Member

From: https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources:

Not all API resource types support Protobuf; specifically, Protobuf isn't available for resources that are defined as CustomResourceDefinitions or are served via the aggregation layer.

Does it work for CRDs that we have?

@Nikhil-Ladha

Copy link
Copy Markdown
Contributor Author

From: https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources:

Not all API resource types support Protobuf; specifically, Protobuf isn't available for resources that are defined as CustomResourceDefinitions or are served via the aggregation layer.

Does it work for CRDs that we have?

Right, it doesn't work for CRDs.
We can't use it for the csi-addons controller code, will have to update and check the pod deployment once.

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.

Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
@Nikhil-Ladha

Copy link
Copy Markdown
Contributor Author

Updated it to add the protobuf encoding only for CLI tool interactions after testing, in other places we have use the client to interact with CRDs.

Comment thread cmd/csi-addons/main.go
@mergify mergify Bot merged commit b2ef27f into csi-addons:main Sep 20, 2024
@Nikhil-Ladha Nikhil-Ladha deleted the use-protobuf-encoding branch June 26, 2025 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants