Skip to content

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.

BlueprintWhat it deploys
demoSingle-node demo: install a package, run it as a service — the smallest end-to-end blueprint.
monitoring-stackPrometheus + Grafana + Loki, ordered so Grafana starts after Prometheus.
nats-clusterA NATS server with JetStream persistence and clustering config.
postgres-haPostgres with WAL streaming replication and a metrics exporter.
production-clusterAn HA control-plane skeleton: embedded etcd, Postgres, and NATS.
security-baselineCIS-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:

ModuleWhat it shows
helloThe minimal module — deterministic, requests no capabilities. Start here.
cmdrunRuns an allowlisted command — the canonical day-2 ops automation.
fsreportReads a file and writes a one-line summary — the filesystem capability.
httpfetchFetches an HTTP resource and returns its status + size.
kvcacheA stateful in-process cache + counter.
secretsyncReads a credential from one scoped secret path and rotates it.
opsbundleA 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.