~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/atlibs-kube

Kubernetes (and kcp) API calls and watches for [atlibs](https://knotless.dev/johnandersen777.bsky.social/atlibs) hosts: a transport on atlibs-host's seam.

0
0
main
44 lines · 1.9 KB Raw History

atlibs-kube

Moved: this crate is transports/kube in atlibs, one commit with the host. This repository is frozen; its pins are not kept.

Kubernetes (and kcp) API calls and watches for atlibs hosts: a transport on atlibs-host's seam.

NSIDwhat
com.fedfork.exec.kube.get, .list{cluster, apiVersion, kind, name?, namespace?, plural?, labelSelector?}
com.fedfork.exec.kube.applyserver-side apply of object or yaml (documents); dryRun
com.fedfork.exec.kube.patch, .deletemerge patch; only objects the run created, or what the host's guard allows
com.fedfork.exec.kube.rawGET {cluster, path} under the server's path (/readyz): {status, text}
com.fedfork.exec.kube.watchsubscription: {type: apply|delete|synced, object} per change

The host names each cluster: a kubeconfig, the /clusters/<workspace> path of a kcp, and how to reach it (direct, overlay, ssh forward, iroh via atlibs-iroh's raw dumbpipe connect, proxy command). A module names the cluster, never a credential. cleanup() after the run: patched specs restored, created objects deleted.

Use

Link it into a Rust host (Cargo.lock from this repo pins the rest):

root=$PWD app=$(mktemp -d)
cp Cargo.lock "$app" && cd "$app" && cargo init -q --name app
cat >> Cargo.toml <<'EOF'
atlibs-host = { git = "https://knotless.dev/johnandersen777.bsky.social/atlibs", rev = "9f1b5ad089faa528b07b49d75965d54535a70e11" }
atlibs-kube = { git = "https://knotless.dev/johnandersen777.bsky.social/atlibs-kube", rev = "f37afdc32cde55062f667bad2dc2765085afb558" }
EOF
cat > src/main.rs <<'EOF'
fn main() {
    let kube = atlibs_kube::Kube::new(Default::default(), None);
    let _transport = kube.transport();
    println!("{}", kube.clusters());
}
EOF
cargo run -q
cd "$root"
{}