Serialization
The Kubernetes lexicon serializes resources into multi-document YAML with
--- separators between resources. Each resource gets the standard K8s
structure: apiVersion, kind, metadata, and spec.
Building
Section titled “Building”Run chant build to produce Kubernetes manifests from your declarations:
chant build src/ --output dist/manifests.yaml# Writes dist/manifests.yamlThe generated file includes:
- Multi-document YAML with
---separators - Correct
apiVersionandkindfor each resource metadata.nameauto-generated from export names (camelCase → kebab-case)- Default labels and annotations injected from
defaultLabels()/defaultAnnotations()
Key conversions
Section titled “Key conversions”| Chant (TypeScript) | YAML output | Rule |
|---|---|---|
export const myApp = new Deployment({...}) | metadata.name: my-app | Export name → kebab-case |
new Container({...}) | Inline container spec | Property types expanded inline |
defaultLabels({...}) | Merged into all resources | Project-wide label injection |
Applying
Section titled “Applying”The output is standard Kubernetes YAML. Apply with kubectl:
# Dry run firstkubectl apply -f dist/manifests.yaml --dry-run=server
# Applykubectl apply -f dist/manifests.yaml
# Diff before applyingkubectl diff -f dist/manifests.yamlCompatibility
Section titled “Compatibility”The output is compatible with:
- kubectl apply/diff
- Helm (as raw manifests)
- ArgoCD / Flux GitOps controllers
- Kustomize (as a base)
- Any tool that processes Kubernetes YAML