Tins · Utilities
k8s
A small Kubernetes client for Mojo: pods, jobs and services created, listed, watched and deleted, and pods' logs, in a pod with its service account or from a kubeconfig. It is what Orca uses to start a Dista cluster per run.
Install
plain pixi:
pixi init app -c https://conda.modular.com/max -c conda-forge && cd app
sed -i.bak 's/^\[workspace\]/[workspace]\npreview = ["pixi-build"]/' pixi.toml
pixi add "mojo-compiler==1.2.0"
# Without mojoshelf: the tin as a git dependency at its published commit.
# Transitive dependencies may be wrong: pixi takes the tin's own git deps as
# pinned in its pixi.toml, which may not match what other tins pin, and then
# fails with "duplicate records". mojoshelf picks revisions that agree.
pixi add k8s-mojo --git https://github.com/magmalake/k8s.mojo --rev 6cb83ce08e02234873f2d09c7501208eedb5589f No mojoshelf needed. If pixi reports duplicate records, the mojoshelf tab picks revisions that agree.
Version
0.1.2 on mojoshelf
What it does
Works today
- Manifests go in as JSON text; objects come back as json values, read with JSON pointers
- A kubeconfig's server, CA, client certificate and key, or a token
- An answer that isn't 2xx raises with the API's own message
- exec and auth-provider users (cloud CLIs) aren't supported: pass a token
Correctness
Checked against Every call against a live kind cluster in CI