Skip to content

pleme-io/wasm-operator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wasm-operator

Kubernetes operator that reconciles ComputeUnit CRs (wasm.pleme.io/v1alpha1) into running wasm-engine workloads. ComputeUnit is the canonical Layer-2 typed resource per theory/META-FRAMEWORK.md §I — one CR per running unit of compute, with a sum-typed trigger.

What it does

For each ComputeUnit resource, the operator ensures one of:

spec.trigger.kind Reconciles to
oneShot Job running the engine once
cron CronJob
service Deployment + Service (+ KEDA ScaledObject if breathability.enabled)
watch Deployment running the engine in controller mode (informer + leader election)
event Deployment subscribed to the configured event source

The engine pod's container image is ghcr.io/pleme-io/wasm-engine:<tag> (override via WASM_ENGINE_IMAGE env). The engine reads COMPUTEUNIT_MODULE_URL, COMPUTEUNIT_TRIGGER, COMPUTEUNIT_CONFIG, COMPUTEUNIT_CAPABILITIES from its environment.

See theory/WASM-STACK.md for the full design.

Deploy

  1. Apply the CRD:
    kubectl apply -f crd/computeunit.yaml
  2. Deploy the operator (Deployment + RBAC ServiceAccount/Role/RoleBinding) — these manifests are owned by the lareira-wasm-platform Helm chart in helmworks.
  3. Apply ComputeUnit CRs — see the example shape in crd/computeunit.yaml's schema or k8s/clusters/rio/programs/release.yaml.

Develop

nix develop                 # devShell with rustc/cargo/kubectl
cargo check                 # type-check
cargo build --release       # native build
nix build .#default          # nix-built binary
nix flake check --no-build   # evaluate flake

To run against a real cluster:

export KUBECONFIG=...
cargo run -- --help
kubectl get cu               # list ComputeUnits (shortname `cu`)

License

MIT.

About

Kubernetes operator that reconciles tatara.pleme.io/Program CRDs to running WASM/WASI pods

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors