Crates.io | mistletoe |
lib.rs | mistletoe |
version | 0.1.2 |
source | src |
created_at | 2023-12-27 02:16:31.633236 |
updated_at | 2024-01-01 01:37:42.796775 |
description | Mistletoe - the Polyglot Kubernetes Package Manager |
homepage | |
repository | https://github.com/gsfraley/mistletoe.git |
max_upload_size | |
id | 1081332 |
size | 746,616 |
Mistletoe is a Kubernetes package manager that goes about things in a different way than the rest of the ecosystem. It's built around a runtime where the packages are WebAssembly modules:
mistletoe_package! {"
name: namespace-example
labels:
mistletoe.dev/group: mistletoe-examples
"}
#[derive(Deserialize)]
pub struct Inputs {
name: String,
}
pub fn generate(inputs: Inputs) -> MistResult {
let name = inputs.name;
let output = MistOutput::new()
.with_file("namespace.yaml".to_string(), formatdoc!("
apiVersion: v1
kind: Namespace
metadata:
name: {name}
"));
Ok(output)
}
The above is a simple package written in Rust. If you run it with:
mistctl generate my-namespace -p mistletoe/examples/namespace-example:0.1.2
You get the following YAML back:
apiVersion: v1
kind: Namespace
metadata:
name: my-namespace
This is one of a nearly-unlimited number of ways to write a package. All you need is a language with a YAML parser that can compile to WebAssembly.
Mistletoe is still very early on in the development lifecycle, but we've made some progress!
As of note, we've implemented the registry system that's used by the above example -- you can add registries by Git URL and reference packages inside them by name now!
There's also a default "mistletoe" registry added that points to mistletoe-registry. There's only the example package up now, but more will be coming soon!
That said, there are still a handful of things that need to be addressed before it could reasonably be opened up for use:
mistctl
utility currently only supports YAML generation -- it should be expanded to support
installation to clusters. This also implies all the usual goodies around lifecycle management, notably
upgrades and uninstallation.There's all that, as well as a number of less-important, but also-desired efforts worth evaluating: