Skip to content
Public template

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

kubemicrovm-ops

A chant adoption kit for KubeMicroVM. Typed declarations, semantic lint, and durable deployment workflows for teams running AWS Lambda MicroVMs through the KubeMicroVM operator.

One source tree, three deployment tiers, two deploy targets, and a local target that costs nothing.

The design documents are a Hugo site, published at intentius.github.io/kubemicrovm-ops — hugo server to read them locally. Start with Tiers and targets — it explains the shape of everything else here.

Try it without an AWS account

git clone https://github.com/INTENTIUS/kubemicrovm-ops
cd kubemicrovm-ops
./go

If you have Docker, that is the whole lead-in. ./go checks the other tools, offers to install whichever are missing — asking first, and never installing Docker itself — then runs npm install and stands the estate up. About four minutes, and nothing in it costs anything.

It brings up a k3d cluster, floci for the AWS plane, m80 for the MicroVMs API, the real KubeMicroVM operator pointed at them, and this kit's estate at the minimal tier.

Everything ./go does is a command you could run yourself, in the order you would run them — just prereqs, npm install, just minimal-local-e2e. It is not a second way to do things. Then:

kubectl -n microvm-demo get microvmimages,microvms
just validate                 # did the estate converge, or merely apply
just view                     # both substrates in one graph, coloured by drift
just local-down

Swap the tier for prod or prod-ha and the same command deploys a class, a VPC egress connector, and a replica set instead of a single VM.

If any of that does not happen, just doctor walks floci, the cluster, m80, the operator and the estate in dependency order and prints the command to run about whichever one is wrong.

What the local target cannot cover

The operator calls four AWS SDK clients, and those are what floci and m80 intercept. What AWS does downstream of them — assuming the build role, fetching your artifact, creating the connector's ENIs — happens inside a service implementation, with no request to redirect and no endpoint to override. So the local target validates that the estate declares and reconciles correctly. It does not validate that AWS will accept the roles at runtime, and nothing runs your code.

The Kubernetes half is not emulated at all: real cluster, real operator, real custom resources, real admission webhook.

The three axes

A tier is how much estate you want: minimal, prod, prod-ha. KMV_TIER selects one and no tier has its own files.

A target is where it deploys. AWS_ENDPOINT_URL set means the local target: floci for the AWS plane, m80 for the MicroVMs API, k3d instead of EKS. Unset means real AWS. Nothing else in the source changes.

An adoption seam is whether the kit provisions a prerequisite, references one you already have, or leaves it out. Seams are per-resource and independent of both tier and target — bucketMode, buildRoleMode, operatorRoleMode, podIdentityMode. The EKS cluster and the VPC are inputs rather than seams; the tiers page says why.

Layout

Path Contents
src/lib/tiers.ts The three tiers, and the only place their differences live
src/lib/target.ts Local or real, chosen by whether AWS_ENDPOINT_URL is set
src/lib/naming.ts One naming and tagging key across both planes
src/aws-plane/ S3 bucket, build role, operator role, pod identity association
src/golden-image/ The operator-less MicrovmApp path, behind a seam that is off by default
src/workload/ Namespaces and the five custom resources
crds/ KubeMicroVM's CRDs, pinned to chart 1.0.11
test/tier-matrix.test.ts Builds every tier and checks each field against those CRDs
.chant/rules/ KMV rules that read one file — a memory size, a required field, an enum
.chant/policies/ KMV rules that read the whole build — namespace labels, reference resolution
test/fixtures/broken/ One deliberately-wrong source per rule
ops/ The install and teardown Ops — the ordering, as a durable workflow
scripts/install/ The steps the Ops call, on either target
scripts/local/ k3d + floci + m80, then the component run
pipelines/ The estate's CI, declared and rendered for GitHub, GitLab and Forgejo
scripts/live/ Real AWS and a real EKS cluster
content/docs/ Design documents
themes/hugo-book Theme (git submodule)

The real target

export AWS_ACCOUNT_ID=… AWS_REGION=us-east-1
export KMV_CLUSTER_NAME=my-eks-cluster
export KMV_SUBNET_IDS=subnet-a,subnet-b KMV_SECURITY_GROUP_IDS=sg-…
just prod-live-e2e

This creates named IAM roles and an S3 bucket in a live account, and costs money. AWS_ENDPOINT_URL must be unset — the script refuses rather than silently deploying an emulator's worth of confidence.

Development

just check          # typecheck, lint, and the tier matrix
just synth          # both planes for the current tier and target

test/tier-matrix.test.ts is the one worth knowing about. It builds all three tiers and checks every emitted spec field against the pinned CRD schemas, because a misspelled field in a custom resource is accepted by the API server and ignored by the controller. A typo in className is a VM silently running with the wrong policy, and nothing else catches it.

Typed CRDs

The typed classes for the five CRDs come from @intentius/chant-lexicon-k8s, which generates them from the same pinned Helm chart crds/ is copied from. Needs 0.36.0 or later: before that, generated CRD classes carried no metadata property, so setting a name or a namespace meant an as any at every call site (chant#1309).

The aws lexicon needs 0.37.1 or later for the same class of reason — MicrovmApp was missing from its package root (chant#1219).

Related

Project Role
chant Core compiler, aws and k8s lexicons, Ops
KubeMicroVM The operator this kit deploys and declares against
m80 The MicroVMs API emulator the local target runs against
floci The AWS emulator serving the local target's prerequisites
behold The live control plane just view opens

Licence

Apache 2.0.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages