Protobuf

451

Protocol Buffers (or protobuf) are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data.

By default, Kubernetes returns objects serialized to JSON with content type application/json. This is the default serialization format for the API. However, clients may request the Protobuf representation of these objects for better performance at scale.

Stuff you wanna know:

  1.  The Protobuf based serialization format is primarily intended for intra-cluster communication.
  2. Kubernetes uses an envelope wrapper to encode Protobuf responses. That wrapper starts with a 4 byte number to help identify content in disk or in etcd as Protobuf (as opposed to JSON), and then is followed by a Protobuf encoded wrapper message, which describes the encoding and type of the underlying object and then contains the object.
  3. Not all API resource types support Protobuf; specifically, Protobuf isn’t available for resources that are defined asCustomResourceDefinitions or are served via the aggregation layer.
  4. While sending an object in Protobuf to the server for a PUT or POST call means that you must set the Content-Type header appropriately.
  5. In Kubernetes, the JSON and Protobuf serialization schemas follow the same guidelines for schema changes.

More stuff: