Building the policy
Thus far, you've built the policy with a compilation target of the same operating system and architecture of your development machine.
It's now time to build the policy as a WebAssembly binary, a
You use the command:
This command builds the code in release mode, with a WebAssembly compilation target.
The build produces a
$ file policy.wasm
policy.wasm: WebAssembly (wasm) binary module version 0x1 (MVP)
Distributing the policy
Kubewarden documents policy distribution in the distributing policies section.
You can find more Rust Kubewarden policies in Kubewarden's GitHub space. This query can help you find them.
The Kubewarden policy repositories, shown by that query, have GitHub Actions that automate the following tasks:
- Run unit tests and code linting on pull requests and after code merges into the main branch.
- Build the policy in
releasemode and push it to an OCI registry as an artifact.