Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
deskribe
Kubernetes resource descriptions in Rust, without starting kubectl.
Give deskribe an existing kube::Client and a resource. It reads the object,
related resources, and events, then returns a text description. Applications can
reuse their current connection and authentication setup.
Experimental. Supports 36 specialized resource kinds and a generic format
for custom resources. The implementation is based on kubectl describers;
upstream.json records the reviewed source baseline. Output is
not guaranteed to match every kubectl version exactly.
Use it
The crate is not published yet. For local development:
[]
= { = "../deskribe" }
= { = "4.2", = false, = ["client", "rustls-tls", "aws-lc-rs"] }
= { = "0.28", = ["latest"] }
Your application chooses the Kubernetes schema and TLS features. The example
above uses the latest schema available in k8s-openapi 0.28 and rustls. Deskribe
does not choose these features for you.
use ;
use ;
async
Pass the resource's discovered ApiResource and the selected object, including
its name, namespace, and UID when known. Clone your existing client if you need
to keep using it after the call.
API
gather(client, resource, selected)fetches a fresh object and related data. The fresh GET uses the discovered API group, version, and plural. HPA v2 can fall back to v1; ServiceCIDR and IPAddress v1 can fall back to v1beta1. These fallbacks require the standard Kubernetes response for a missing endpoint. Other errors are returned without a version fallback. If the fallback fails, the original error is returned. It checks the selected UID when available, so an object recreated with the same name is not silently substituted. It follows paginated lists and overlaps independent requests.Description::render(&options)returns text without making network calls. Options control the current time and timezone. Defaults use the current time and the system timezone.fetch(client, resource, selected)gathers and renders with default options, returning(DynamicObject, String).
You can render the same snapshot more than once. Gather again to refresh its data. Dropping the gather future cancels the operation; requests already sent cannot be recalled.
Deskribe does not load kubeconfig, run subprocesses, create a runtime, print to stdout, or manage a UI. Those are the caller's responsibilities.
Errors and sensitive data
The client needs permission to read the object and the related resources used by its describer. Errors are returned as strings. Some optional reads are best-effort; for example, denied or unavailable ResourceSlice access does not fail a Node description.
If a Pod read fails but events are available, its description can show the error
and those events. In that case, Description::object() returns the original
selection rather than a fresh object.
Descriptions can contain secrets. Service-account Secret descriptions show
data.token, as kubectl does. Other Secret values are shown as byte counts.
Do not send descriptions to public logs or telemetry. Helm release notes belong
to the calling application, not this library.
Development
Rust tests cover synthetic output snapshots, resource accounting, and the public fetch/render API. They do not need a cluster or Go. Sofka keeps separate TUI integration tests.
Code structure
resource.rsselects the resource kind and event rules.fetch.rsgathers data through the API helpers inapi.rs.description.rsstores the snapshot type and selects its renderer.- Resource modules contain the related reads and text rendering for each group.
Networking resources are in
networking/; Jobs and CronJobs are inbatch.rs. metadata.rs,events.rs,time.rs,format.rs, andjson.rscontain shared functions.tests/corpus.rschecks and updates fixtures through the public gather and render API.
After reviewing an intentional output change, regenerate snapshots with:
DESKRIBE_UPDATE_FIXTURES=1
Review every changed snapshot. Regeneration alone does not prove correctness.
Upstream changes
The Upstream changes GitHub workflow runs weekly and can be started manually.
It compares the source paths in upstream.json with the latest
stable kubectl module tag, using the same tag for related Kubernetes repositories.
A source change marks the run as failed to request review. The run summary and
upstream-report artifact contain the changed file list, commit IDs, and patches.
Fetch errors are reported separately. The workflow does not run Go, edit Rust
code, advance the baseline, or open pull requests.
See upstream maintenance for local commands and review steps. This checks source changes, not Rust output parity or every upstream dependency.
Publishing
A published GitHub Release triggers checks and a crates.io upload using trusted
publishing. Use just release patch|minor|major from clean main after the
one-time crates.io setup. This publishes only the crate, not binaries.
See release setup and commands, including the initial publish
required before trusted publishing can be configured. just package verifies
the crate without uploading it.
License
Apache-2.0. Adapted from Kubernetes and extracted from sofka. See LICENSE-APACHE and NOTICE.