Learn App Definition and Development / Application Definition & Image Build

Technology Guide

cdk8s

License: Apache-2.0

cdk8s Logo

Field Guide

Complete Guide

cdk8s (Cloud Development Kit for Kubernetes) lets you define Kubernetes resources in TypeScript, Python, Java, or Go instead of YAML, and then synthesizes the result to plain manifests you can apply with kubectl or any GitOps tool. It was created at AWS by the same team behind the AWS CDK, open sourced in 2020, and donated to the CNCF sandbox shortly after.

Under the hood cdk8s uses the Constructs Programming Model (the same constructs library that powers AWS CDK and Terraform CDK). You import type-safe classes generated from the Kubernetes OpenAPI spec — Deployment, Service, Ingress — instantiate them as a tree of constructs, and call app.synth() to produce YAML in dist/. Because it’s real code, you get a real type checker, real tests, real loops and conditionals, and real IDE autocomplete against the Kubernetes API. The cdk8s+ library provides higher-level abstractions (e.g. WebService) that compose multiple primitives.

cdk8s occupies the same slot as Pulumi (Kubernetes provider), Helm, Kustomize, and jsonnet-based tools like Tanka. Its distinguishing trait is that it is pure code-to-YAML — nothing runs in the cluster, there’s no state, no lock-in. That makes it a pragmatic choice if you already write TypeScript or Python and want strong typing over Kubernetes manifests without adopting a full IaC tool. It’s also the easiest way to build reusable, shareable abstractions over Kubernetes resources for an internal platform team.

No articles found for cdk8s yet. Check back soon!