litek8s Demo Guide
The legacy litek8s serve daemon (see legacy-daemon.md) is a small Docker-backed orchestrator. The idea is simple: one local control plane, familiar kubectl-style commands, a reduced Deployment manifest, and enough observability to show scheduling, limits, restarts, and a remote node.
1. Start the control plane
Section titled “1. Start the control plane”Run the local daemon in one terminal:
cargo run -- serveThis process is the local control loop. It stores desired state, reconciles deployments, and exposes the CLI API over a Unix socket.
2. Register the remote node
Section titled “2. Register the remote node”In another terminal, bootstrap and register server77:
cargo run -- node add server77 --ssh server77 --install --label role=edge --label zone=labcargo run -- get nodesWhat this does:
- detects the remote OS and architecture
- builds a compatible
litek8sbinary - copies it over SSH
- validates the remote Docker connection
- registers the node with labels
Expected result:
localappears asReadyserver77appears asReadyserver77shows labelsrole=edge, zone=lab
3. Launch the demo workloads
Section titled “3. Launch the demo workloads”Apply the local workloads first:
cargo run -- apply -f examples/nginx.yamlcargo run -- apply -f examples/http-echo.yamlcargo run -- apply -f examples/cpu-burn.yamlcargo run -- apply -f examples/logstorm.yamlcargo run -- apply -f examples/oom-demo.yamlThen apply the remote workloads:
cargo run -- apply -f examples/http-echo-server77.yamlcargo run -- apply -f examples/http-echo-edge.yamlWhat each workload demonstrates:
demo-nginx: a small web server onlocalhost:8089echo-demo: a tiny HTTP service onlocalhost:8090cpu-burn: a container that burns CPU sotoplooks alivelogstorm: a noisy container for log streamingoom-demo: an intentional memory crash loop to show limits and restart backoffecho-server77: explicit placement onserver77withnodeNameecho-edge: placement onserver77vianodeSelector: role=edge
4. Observe the system
Section titled “4. Observe the system”Check the current state:
cargo run -- get deploymentscargo run -- get nodesOpen the live view:
target/debug/litek8s top --watch --interval-secs 1target/debug/litek8s tree --watch --interval-secs 1What to look for:
- daemon CPU and memory at the top
NODEshowing whether a deployment is local or remoteoom-demomoving betweenRunningandRestartingRESTARTS,STREAK, andNEXT RETRYincreasing whenoom-demohits OOMtreeshowing the actual relationships: control plane -> node -> deployment -> published port/service
Watch the control-plane history:
cargo run -- events --watchcargo run -- events --deployment echo-edgecargo run -- events --node server77 --watchThis is useful to show scheduling, starts, backoff, restart, and node registration.
Use tree when you want topology; use events when you want timeline.
5. Inspect a few specific workloads
Section titled “5. Inspect a few specific workloads”Remote placement by selector:
cargo run -- describe deployment echo-edgecargo run -- describe node server77Expected points:
echo-edgeshould shownode selector: role=edgeecho-edgeshould be assigned toserver77server77should show labelsrole=edge, zone=lab
Controlled scheduling:
cargo run -- node cordon server77cargo run -- get nodescargo run -- node uncordon server77Expected points:
get nodesshould showserver77asCordonedafter the first command- selector-based new placements should avoid cordoned nodes
- existing workloads already assigned to
server77should remain there
OOM and backoff behavior:
cargo run -- describe deployment oom-demoExpected points:
- memory limit should be
64Mi last exitshould often beoom(137)next retryshould show the restart backoff
Logs:
cargo run -- logs logstorm --tail 20HTTP checks:
curl http://localhost:8089curl http://localhost:8090If server77 exposes the remote ports to a reachable interface, you can also test the remote services directly from that host or over your LAN.
Local proxy access:
cargo run -- proxy echo-demo --listen 127.0.0.1:9000Then in another terminal:
curl http://127.0.0.1:9000For the remote edge deployment:
cargo run -- proxy echo-edge --listen 127.0.0.1:9002Then:
curl http://127.0.0.1:9002This proxy is intentionally simple:
- it uses the deployment’s published
hostPort - local deployments connect directly to
127.0.0.1:<hostPort> - remote SSH nodes are reached through an
ssh -Wtunnel per connection - it is TCP-level forwarding, so it also works for simple non-HTTP TCP demos
Daemon-managed service:
cargo run -- service add echo-svc --deployment echo-demo --listen 127.0.0.1:9100cargo run -- get servicescargo run -- describe service echo-svcThen:
curl http://127.0.0.1:9100For the remote edge deployment:
cargo run -- service add edge-svc --deployment echo-edge --listen 127.0.0.1:9102cargo run -- describe service edge-svccurl http://127.0.0.1:9102This service layer is intentionally small:
- it can be configured by CLI or by a small declarative
Servicemanifest - the daemon owns the listener, so it survives after the CLI command exits
- each incoming connection resolves the deployment’s current node and published port
- it gives you a stable local entrypoint without adding kube-proxy or an ingress stack
- the selector must resolve to exactly one deployment in v1; there is no built-in service load balancing yet
Declarative service YAML:
cargo run -- apply -f examples/http-echo-service.yamlcargo run -- get servicescargo run -- describe service echo-svccurl http://127.0.0.1:9100And for the remote edge deployment:
cargo run -- apply -f examples/http-echo-edge-service.yamlcargo run -- describe service edge-svccurl http://127.0.0.1:9102The preferred declarative shape is intentionally tiny and k8s-like:
apiVersion: litek8s.dev/v1alpha1kind: Servicemetadata: name: edge-svcspec: selector: app: echo-edge ports: - port: 9102 targetPort: 5678What this means:
selectormatches a deployment by labels such asmetadata.labels.app: echo-edgeportbecomes the stable local listener, here127.0.0.1:9102targetPortis optional; if omitted,litek8suses the deployment’s published TCP port- the older
deploymentName+listenAddrform still works, butselector+portsis the preferred demo path now
6. Suggested demo script
Section titled “6. Suggested demo script”If you want a short verbal flow while presenting:
- Start
serveand explain that the control plane is one local Rust process. - Show
get nodesand explain thatserver77is added over SSH, not with a heavy cluster stack. - Apply
echo-edgeand show that scheduling happens through node labels, not just hard-coded node names. - Open
tree --watchfirst and show the real topology: which node owns which deployments, and which services attach to them. - Open
top --watchnext and point out daemon overhead, workload CPU pressure, and theoom-demobackoff loop. - Open
events --node server77 --watchorevents --deployment echo-edgeand show that the control plane is emitting readable lifecycle events withoutoom-demonoise. - Run
proxy echo-edge --listen 127.0.0.1:9002andcurl http://127.0.0.1:9002to show raw remote access without a Service or ingress stack. - Run
apply -f examples/http-echo-edge-service.yamlandcurl http://127.0.0.1:9102to show the next level up: a declarative stable entrypoint owned by the daemon and selected by labels. - Finish with
describe deployment echo-edge,describe service edge-svc, anddescribe deployment oom-demoto connect scheduling, access, and resource limits.
7. Cleanup
Section titled “7. Cleanup”Delete the deployments when you are done:
cargo run -- delete deployment demo-nginxcargo run -- delete deployment echo-democargo run -- delete deployment cpu-burncargo run -- delete deployment logstormcargo run -- delete deployment oom-democargo run -- delete deployment echo-server77cargo run -- delete deployment echo-edge