Examples
Runnable examples ship in the repository under
modules/examples/
.
Each is self-contained — clone the repo and run it against a dev cluster.
This page is a map; follow a link for the example’s README and files.
Blueprints
A blueprint packages a multi-resource deployment as a reusable,
parameterized unit (kscore-blueprint apply <dir>). See
Authoring a Blueprint
for the
format and lifecycle. Each example below has a blueprint.yaml,
apply.yaml, rollback.yaml, and a README.
| Blueprint | What it deploys |
|---|---|
demo | Single-node demo: install a package, run it as a service — the smallest end-to-end blueprint. |
monitoring-stack | Prometheus + Grafana + Loki, ordered so Grafana starts after Prometheus. |
nats-cluster | A NATS server with JetStream persistence and clustering config. |
postgres-ha | Postgres with WAL streaming replication and a metrics exporter. |
production-cluster | An HA control-plane skeleton: embedded etcd, Postgres, and NATS. |
security-baseline | CIS-aligned host hardening: sysctl tuning and a default-deny firewall. |
Module examples (Starlark)
Extension modules written in Starlark, sandboxed by capability — see Authoring & Publishing a Module . They run from the simplest possible module up to a composite ops bundle:
| Module | What it shows |
|---|---|
hello | The minimal module — deterministic, requests no capabilities. Start here. |
cmdrun | Runs an allowlisted command — the canonical day-2 ops automation. |
fsreport | Reads a file and writes a one-line summary — the filesystem capability. |
httpfetch | Fetches an HTTP resource and returns its status + size. |
kvcache | A stateful in-process cache + counter. |
secretsync | Reads a credential from one scoped secret path and rotates it. |
opsbundle | A composite module that pins companion modules — the real-world pattern. |
State files
The Using State Management
guide walks a
complete state file (user + package + file + service with requisites). The
in-repo integration fixtures under
internal/statemgmt/testdata/
are additional worked state files, and every module’s reference page in
State Modules
carries runnable snippets.