Skip to main content

Crate hyprstream_k8s

Crate hyprstream_k8s 

Source
Expand description

Kubernetes CRD schemas for hyprstream resources under *.hyprstream.io.

This is the foundation crate for the kube-rs track of the Kubernetes epic (#778). It defines the hyprstream → Kubernetes projection: hyprstream resources as declarative Kubernetes objects, subspaced under hyprstream-owned API groups so nouns never collide with third-party CRDs (serving.hyprstream.io/InferenceService ≠ serving.kserve.io/InferenceService by construction).

§Single-writer rule (baked into every schema)

Git owns the weights. For every resource here, spec is desired STEP intent (Stage → Train → Evaluate → Promote) and status is observed git/runtime truth. The operator that reconciles these (K5b/K5c) is a translator, never a second writer of weights: promotion is a git merge and rollback is a git checkout, both performed through RegistryService. Nothing in these CRDs is authoritative over the weights themselves.

§Two-writer drift guard

Objects owned by the hyprstream operator carry the MANAGED_BY_LABEL (value MANAGED_BY_VALUE) and ownerReferences to their parent. Each driver refuses to adopt objects it does not own.

§Confused-deputy guard

mesh::TenantBinding is the explicit, admin-created mapping between a Kubernetes namespace and a hyprstream tenant. It is gated by the federation:register scope and is the anchor the reconcilers (K5b) use to reject any cross-tenant reference that a binding does not cover. It is deliberately cluster-scoped so a tenant confined to its own namespace cannot forge its own binding.

§Feature layout

  • default (no features): CRD type definitions, schema derivation, CEL validation and YAML emission — all compile with no cluster present.

  • k8s: pulls in the kube client + controller-runtime for code that needs a live API server (see the install module). CRD types never require it.

  • grant: exposes only the service-neutral grant::TenantGrantService boundary and generic TenantBinding status projection. Authority-bearing signing and PDS allocation behavior moved to the downstream, AGPL-licensed hyprstream-k8s-pds crate in #1422.

    Previous pathNew path
    hyprstream_k8s::grant::TenantGrantIssuerhyprstream_k8s_pds::TenantGrantIssuer
    hyprstream_k8s::grant::TenantGrantVerifierhyprstream_k8s_pds::TenantGrantVerifier
    hyprstream_k8s::grant::CompiledTenantGranthyprstream_k8s_pds::CompiledTenantGrant
    hyprstream_k8s::grant::VerifiedTenantGranthyprstream_k8s_pds::VerifiedTenantGrant
    hyprstream_k8s::grant::TENANT_GRANT_ED25519_PURPOSEhyprstream_k8s_pds::TENANT_GRANT_ED25519_PURPOSE
    hyprstream_k8s::grant::TENANT_GRANT_ABILITYhyprstream_k8s_pds::TENANT_GRANT_ABILITY
    hyprstream_k8s::grant::now_unixhyprstream_k8s_pds::now_unix for adapter callers; the substrate helper remains at its old path
    operator::run_operator_with_grant_issueroperator::run_operator_with_grant_service
    OperatorState::with_grant_issuerOperatorState::with_grant_service
    compile_tenant_binding_status(binding, issuer, epoch, now)compile_tenant_binding_status(binding, service, epoch, now), where service is Option<&dyn TenantGrantService>

    The adapter crate contains a compiling k8s,grant operator composition example and compile fixture.

All CRDs are v1alpha1; the conversion/upgrade path to a future stored version is noted per-resource and is out of scope for this crate (K5b owns the conversion webhook).

Re-exports§

pub use mesh::TenantBinding;
pub use mesh::TenantBindingSpec;
pub use mesh::TenantBindingStatus;
pub use mesh::TenantEntitlement;
pub use mesh::TenantGrantClass;
pub use models::Adapter;
pub use models::AdapterSpec;
pub use models::AdapterStatus;
pub use models::Model;
pub use models::ModelSpec;
pub use models::ModelStage;
pub use models::ModelStatus;
pub use serving::InferenceService;
pub use serving::InferenceServiceSpec;
pub use serving::InferenceServiceStatus;
pub use serving::Statefulness;
pub use training::ResourceSpec;
pub use training::TrainingRun;
pub use training::TrainingRunSpec;
pub use training::TrainingRunStatus;
pub use ::k8s_openapi;
pub use ::kube;

Modules§

grant
Service-neutral TenantBinding grant reconciliation contract (#929/#1422).
mesh
mesh.hyprstream.io/v1alpha1 — TenantBinding.
models
models.hyprstream.io/v1alpha1 — Model and Adapter.
serving
serving.hyprstream.io/v1alpha1 — InferenceService.
training
training.hyprstream.io/v1alpha1 — TrainingRun.

Constants§

API_VERSION
The API version shared by every CRD in this crate.
MANAGED_BY_LABEL
Label applied to every object the hyprstream operator manages.
MANAGED_BY_VALUE
Canonical value for MANAGED_BY_LABEL.

Functions§

all_crds
Every CRD defined by this crate, in a stable order.
crd_manifests
(kind, plural_group, filename_stem) triples for each CRD, used to name the emitted YAML files deterministically.