Rust is the most mature programming language that can generate WebAssembly modules: WebAssembly is a first-class citizen in the Rust world. That means many of the tools and crates of the Rust ecosystem work out of the box.
This document illustrates how to take advantage of these projects to write Kubewarden policies using the Rust programming language.
Note well, we won't cover the details of Kubewarden's Rust SDK inside of this page. These can be found inside of the official crate documentation.
Getting Rust dependencies
This section guides you through the process of installing the Rust compiler and its dependencies.
rustup is installed add the Wasm target:
rustup target add wasm32-unknown-unknown
OSX specific dependencies
In order to use
cargo-generate you will need to add the Xcode tool set. If it isn't installed through Xcode the following command will give you the dependencies needed: