Kinetic Environments on k3s: Under the Hood
MicroStax is built on k3s — a lightweight, production-grade Kubernetes distribution. In this post, we walk through exactly how an environment goes from a YAML Blueprint to a live, isolated stack in under 60 seconds.
Why k3s?
When we chose our orchestration layer, we evaluated full Kubernetes, Nomad, and Docker Swarm. k3s won on three key dimensions: startup time, resource overhead, and edge-node compatibility.
A barebones k3s node consumes less than 512MB of RAM at idle. That means you can run a meaningful fleet of environments on hardware you already own — or on a small cloud instance — without the operational overhead of managing a full Kubernetes control plane.
The Blueprint Lifecycle
When you run mstax up -b ./blueprint.yaml, MicroStax goes through four phases:
- Parse & Validate: The Blueprint YAML is parsed and validated against the MicroStax schema. Service dependencies are resolved into a directed acyclic graph (DAG).
- Namespace Provisioning: A dedicated Kubernetes namespace is created for the environment (e.g.,
env-pr-221-abc1f). Network policies are applied immediately to enforce isolation. - Topology Scheduling: Services are scheduled topologically — databases and caches first, application services next, ingress last. Each pod is annotated with metadata linking it to your environment ID.
- Readiness Probing: MicroStax polls readiness gates for each service. Once all services pass their health checks, the environment is promoted to the
runningstate and surfaces the environment URL.
Namespace Isolation
Isolation is not just a feature — it is the foundational guarantee of MicroStax. Every environment lives in its own namespace with:
- Dedicated NetworkPolicies that prevent cross-environment traffic by default.
- Scoped RBAC roles so service accounts can only access their own namespace resources.
- Separate PersistentVolumeClaims for databases, ensuring stateful services never share underlying storage.
This means two engineers can run identical stacks simultaneously with zero interference — even if they deploy the same blueprint unchanged.
Auto-Shutdown and Hibernation
Running environments indefinitely is expensive. MicroStax solves this with a two-stage lifecycle model:
Stage 1 — Hibernation: After a configurable inactivity window (default: 30 minutes), MicroStax scales all non-stateful deployments to zero replicas. Stateful sets (databases, caches) remain online. The environment is still reserved; resuming it takes about 15 seconds.
Stage 2 — Teardown: After the full TTL expires (configurable per environment), the entire namespace is deleted and resources are reclaimed. Any state you want to preserve should be captured as a Snapshot first.
"The auto-shutdown alone reduced our cloud bill by 40% compared to always-on staging." — Early Access Customer
Snapshots: Freezing Time
The Snapshot feature lets you capture the complete state of a running environment and restore it later. Under the hood, MicroStax:
- Flushes write-ahead logs for all registered databases.
- Runs a consistent export of each PersistentVolume using the configured storage driver.
- Records the current image tags and resource spec of every running workload.
- Stores the bundle in your configured object storage (S3 or GCS).
Restoring a Snapshot creates a fresh environment namespace pre-seeded with the captured data, using the exact same image tags at the time of capture. This is invaluable for reproducing bugs in long-lived test states.
What's Coming
We are actively working on multi-node k3s cluster support, meaning you will be able to spread your fleet across geographically distributed agent nodes for lower latency testing. We are also adding a GitOps webhook mode where pushing to a branch automatically provisions an environment — no CLI invocation needed.