kube-rs / k8s-pb

Playing with Kubernetes protobufs
Apache License 2.0
19 stars 6 forks source link
kubernetes protobuf rust

k8s-pb

Crates.io

Kubernetes protobuf bindings for kube-rs. WIP. Not yet useable as is.

Usage

This library is not currently usable from kube. For now consider these structs a reference location for Kubernetes structs that are not found in k8s-openapi. See docs.rs/k8s-pb.

Build Process

The code generation process consists of 4 steps;

  1. just protos - download and patch protobufs
  2. just swagger - download and transform openapi schema
  3. just codegen - combine info and build with prost
  4. just names - case alignment and cargo fmt

This can be run in one step with just generate.

The k8s-pb crate is generated as a result of this process and then published periodically.

just protos

Obtains the version pinned protobufs from upstream:

then does minor transforms to prepare them for building.

just swagger

Obtains the version pinned swagger openapi schema from upstream:

then applies any needed patches before transforming the schema into a shorter json file containing desired generic information.

This json file complements the protos with type type properties needed for trait implementations.

just codegen

Runs main.rs, using the outputs from the swagger and protobuf recipes above. In particular;

Build Dependencies