Getting Started
llms.txt lists every page for an agent
Show the whole prompt
Read https://intentius.io/chant/lexicons/k8s/getting-started/.
In a new directory, install the k8s lexicon, write the `WebApp` from the page in `src/infra.k8s.ts`, and run `npx chant build --output dist/manifests.yaml`.
Create a local k3d cluster, apply the manifests to it, check that the pods are ready, and show me the output. Delete the cluster when you are done.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.Optional: hand this page to your coding agent
Read https://intentius.io/chant/lexicons/k8s/getting-started/.In a new directory, install the k8s lexicon, write the `WebApp` from the page in `src/infra.k8s.ts`, and run `npx chant build --output dist/manifests.yaml`.Create a local k3d cluster, apply the manifests to it, check that the pods are ready, and show me the output. Delete the cluster when you are done.Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.What is chant?
Section titled “What is chant?”You write TypeScript, and chant builds it into Kubernetes YAML for kubectl apply.
Install
Section titled “Install”npm install --save-dev @intentius/chant @intentius/chant-lexicon-k8sYour first deployment
Section titled “Your first deployment”Start with the WebApp composite, one function call that returns a Deployment, a Service and an optional Ingress:
import { WebApp } from "@intentius/chant-lexicon-k8s";
const app = WebApp({ name: "hello", image: "nginx:1.25", port: 80, replicas: 2,});
export const { deployment, service } = app;Build and deploy:
# Generate YAML manifestschant build --output dist/manifests.yaml
# Validate against the cluster API (no changes applied)kubectl apply -f dist/manifests.yaml --dry-run=server
# Apply for realkubectl apply -f dist/manifests.yamlUsing resource constructors
Section titled “Using resource constructors”You can also call the resource constructors directly:
import { Deployment, Service, Container, Probe } from "@intentius/chant-lexicon-k8s";
export const deployment = new Deployment({ metadata: { name: "hello", labels: { "app.kubernetes.io/name": "hello" } }, spec: { replicas: 2, selector: { matchLabels: { "app.kubernetes.io/name": "hello" } }, template: { metadata: { labels: { "app.kubernetes.io/name": "hello" } }, spec: { containers: [ new Container({ name: "web", image: "nginx:1.25", ports: [{ containerPort: 80, name: "http" }], livenessProbe: new Probe({ httpGet: { path: "/", port: 80 } }), readinessProbe: new Probe({ httpGet: { path: "/", port: 80 } }), }), ], }, }, },});
export const service = new Service({ metadata: { name: "hello" }, spec: { selector: { "app.kubernetes.io/name": "hello" }, ports: [{ port: 80, targetPort: 80, name: "http" }], },});Composites return plain prop objects. Resource constructors (new Deployment(...)) accept the same shape. Both produce identical YAML.
Next steps
Section titled “Next steps”- Kubernetes Concepts — how K8s resources map to chant constructs
- Examples: Composites — WebApp, CronWorkload, AutoscaledService, and more
- Lint Rules — built-in checks for security, reliability, and best practices