Skip to main content
Account

CUE

CUE is a data constraint language for validating data and generating configuration. Learn unification, schemas, and how to use CUE with Kubernetes and CI.

Status
Stable
Category
App Definition and Development
Subcategory
Application Definition & Image Build
License
Apache-2.0
Technology matrix Advocate Championing See the matrix

CUE (Configure, Unify, Execute) is a data constraint language from Marcel van Lohuizen, who previously worked on Borg’s configuration language (BCL/GCL) at Google. It’s a superset of JSON where types and values live in the same lattice: int is a constraint satisfied by all integers, >0 is a narrower constraint, 42 is the narrowest. Unification — CUE’s core operation — combines any two values into the most specific value that satisfies both, or fails with a clear conflict. This means schemas, defaults, and concrete data compose associatively and commutatively, and order of imports doesn’t matter.

In practice, CUE is used for Kubernetes manifests (it round-trips to YAML and JSON, and can import OpenAPI, Protobuf, and JSON Schema), generating configuration across multiple systems from a single source of truth, validating data in CI, and as the base language for higher-level tools — Dagger’s pipelines originally used CUE, Istio uses it internally for CRD validation, and Timoni is a Helm-alternative built entirely on CUE modules. It has a package manager (cue mod), a central registry, and modules with SemVer.

Compared to Jsonnet, Dhall, or Helm templates, CUE’s win is that there is no separate templating language layered on top of your data: constraints, defaults, and values are all the same thing, and conflicts are statically detectable. The cost is a steep learning curve — unification, disjunctions, and the type lattice are unfamiliar to most engineers arriving from YAML and Go templates.

CUE recordings

8 recordings, newest first

Application Definition & Image Build

Email signup loads here. You can also manage email preferences in account settings.

Build CUE? I'll show you where engineers get stuck with it → Back free content for the community →