Skip to main content
Every Package that akua pkg init scaffolds is typed against one Kubernetes version, and every CustomResourceDefinition you add as a dependency becomes a typed schema. A misspelled field, a wrong type, a value outside an enum or an API your Kubernetes version does not serve fails the render with the file and line, before anything reaches a cluster. This guide assumes the akua CLI is installed (brew install akua-dev/tap/akua). Every command also works with the standalone akuapkg binary.
1

Scaffold a typed Package

init declares the Kubernetes 1.35 schemas in akua.toml, pins them by digest in akua.lock, and writes a package.k that uses them:
2

Add a CRD dependency

add downloads the CRDs, pins their sha256 and generates KCL schemas into .akua/crds/:
The output names the modules to import, for example import crds.cert_manager.cert_manager_io.v1 (Certificate, CertificateRequest, ClusterIssuer, Issuer).
3

Use the typed schemas

Replace package.k with a typed ConfigMap and a typed Certificate:
4

Render

The render writes two manifests to ./deploy. Commit akua.toml, akua.lock and .akua/crds/.

What a mistake looks like

Change "ECDSA" to "ECDSB" and render again:
Misspelled fields fail with a suggestion (Cannot add member 'secretname' to schema 'CertificateSpec', did you mean ...), and a number where Kubernetes expects a string fails with expected str, got int. Every one of these exits with code 1 and error code E_RENDER_KCL.

Kubernetes versions

The default is the oldest Kubernetes minor version still supported upstream, 1.35, so what renders applies to every supported cluster. A version switch type-checks the whole Package against the new release: an API it no longer serves, such as flowcontrol.apiserver.k8s.io/v1beta3 from Kubernetes 1.32 on, fails the render.

CRD sources

Any dependency source works, with crds = true for the whole source or a path inside it:
Imports follow crds.<dependency>.<group>.<version>, with - and . turned into _. The generated .akua/crds/ directory is committed; a render that finds it out of date with akua.toml or akua.lock fails with E_CRDS_STALE until you run akua pkg lock. The conversion rules, naming details and known limits are in the upstream typed resources guide.

Why typed and sandboxed

The problems with untyped templates and unsandboxed renderers.

Package format

The Input schema, @ui annotations and composition.

akua pkg add

Every flag of the command that adds dependencies.

Example: typed CRDs

A runnable Package with Kubernetes types and a CRD from a git tag.