Skip to content

Philosophy

Core Philosophy

TypeKro bridges type-safe development and runtime-aware infrastructure. Write infrastructure like application code—with full IDE support, compile-time validation, and runtime intelligence.

The key insight: Kubernetes resources reference each other's live state. TypeKro expresses these relationships in TypeScript, converting them to CEL expressions that evaluate at runtime.

Three-Layer Architecture

TypeScript (Compile-time)     →  CEL (Runtime)           →  Kubernetes (Cluster)
─────────────────────────────────────────────────────────────────────────────────
Type safety & IDE support        Expression evaluation       Resource management
Schema validation                Cross-resource refs         Status updates
Reference tracking               Conditional logic           Reconciliation

Why TypeKro?

Simple deployments: Type-safe APIs with IDE autocomplete catch errors before deployment. Direct mode deploys immediately.

Complex systems: Cross-resource references, runtime status aggregation, and reusable composition patterns.

Any workflow: Generate deterministic YAML for GitOps, or deploy directly. Same TypeScript code, multiple strategies.

Design Principles

  1. TypeScript-native - No DSLs, no YAML templating
  2. Stateless - No state backend, standard Kubernetes resources
  3. GitOps-ready - Deterministic YAML output
  4. Progressive complexity - Start simple, add sophistication as needed

Terminology

TermMeaning
CompositionThe result of kubernetesComposition() - a reusable template that defines resources and status
Composition FunctionThe callback passed to kubernetesComposition() that creates resources
Schema ProxyThe proxy for the spec parameter that creates KubernetesRef objects when you access spec.name
Magic ProxyThe proxy wrapping resources that creates KubernetesRef objects when you access deploy.status.ready
Resource FactoryFunctions like Deployment(), Service() that create Kubernetes resources
Deployment FactoryThe `composition.factory('direct'
idResource identifier for CEL path generation (not the Kubernetes name)
nameThe Kubernetes resource name in metadata.name
Direct ModeTypeKro deploys resources directly to the cluster, no Kro controller needed
Kro ModeTypeKro generates ResourceGraphDefinitions for the Kro controller to manage
CELCommon Expression Language - used by Kro for runtime expression evaluation

When is Kro Required?

Quick Decision

  • Use Direct mode for development, testing, and simple deployments
  • Use Kro mode when you need runtime CEL evaluation or continuous reconciliation

See Deployment Modes for the complete comparison.

Next Steps

Released under the Apache 2.0 License.