published fresh until

Kubernetes with TypeScript: cdk8s or Terraform CDKTF?

Summary As of October 2026, avoid new CDKTF deployments because HashiCorp ended support; use cdk8s for Kubernetes manifests, keep cloud provisioning separate, and generate manifests with cdk8s synth.

Not for pnpm 11.28.7 or 12.16.1 install repairs; see pnpm-11-28-7-registry-revisions-12-16-1-cargo-pack-fixes. Also excludes full Terraform state migration and AWS CDK deployment tutorials.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Use cdk8s to generate Kubernetes manifests from TypeScript; do not start a new supported cloud-provisioning project on the deprecated CDKTF.

Do first: run npm install -g cdk8s-cli for the fresh cdk8s recipe

Write down whether you need networks, databases and the cluster itself, or resources inside an existing cluster. cdk8s addresses the latter. HashiCorp's CDKTF documentation says support and maintenance ended on December 10, 2025. These tools are not interchangeable deployment engines.

Recipe for a fresh cdk8s app

1. Use a supported Node runtime and the stable cdk8s toolchain. In an empty project directory run the official TypeScript quickstart commands:

npm install -g cdk8s-cli
cdk8s init typescript-app

Commit the generated dependency lockfile and record cdk8s --version and npm ls cdk8s constructs. Do not substitute prerelease tags. The documentation identifies the stable toolchain as 2.x; CLI and core library are separate packages, not matching version numbers.

2. Replace the empty chart with an authored ConfigMap example in main.ts:

import { App, Chart, ApiObject } from 'cdk8s'
const app = new App()
const chart = new Chart(app, 'preferences')
new ApiObject(chart, 'settings', {
  apiVersion: 'v1',
  kind: 'ConfigMap',
  metadata: { name: 'app-preferences' },
  data: { theme: 'light' },
})
app.synth()

The ApiObject reference describes raw Kubernetes objects. Use generated resource bindings or higher-level constructs once the basic synthesis boundary is clear.

3. Run cdk8s synth. Inspect dist for a ConfigMap with the expected name and value. Review the YAML diff as a deployment artifact. cdk8s's overview explains that synthesis does not apply anything to the cluster; deployment belongs to a separate reviewed Kubernetes or GitOps step. 4. Add a synthesis assertion that checks the generated resource kind, name and data. If adding workloads, test selectors and service ports too. Keep credentials and secret values out of the authored manifest example.

Existing CDKTF boundary

Keep existing provider and state ownership intact while evaluating an exit. HashiCorp's sunset notice documents cdktf synth --hcl as an export starting point for Terraform-compatible files. Review those files, provider constraints, resource addresses and backend configuration before planning a migration. Generating HCL is not evidence that a stateful deployment can be replaced without changes; cdk8s cannot take over arbitrary Terraform resources.

Versions, licences and costs — checked 2026-10-28

OptionWhat it is forWhen it winsWhen it loses / cost boundary
CDKTF, archivedProgrammatic Terraform configurationTemporary maintenance of an existing pinned project while planning its exitNo maintained release line or future compatibility fixes; MPL per HashiCorp's notice; infrastructure/provider costs remain separate
cdk8s stable 2.x toolchainKubernetes application manifest generationTypeScript abstractions and reviewable YAML for an existing clusterDoes not provision general cloud infrastructure or apply manifests; Apache-2.0 licence; cluster/cloud costs remain separate

No subscription price or deployment quota is established for local synthesis in the cited docs. Exact current core/CLI patch versions are not established here; record and lock the stable versions installed by the quickstart rather than treating a docs version as a package pin. Pick CDKTF only if maintaining an existing installation with an explicit support-risk owner. Pick cdk8s if Kubernetes manifests are the desired output.

Public evidence

  • Issue 3270, Yang-33, 2026-09-14, reports that generated names are truncated “even for resources that allow 253 characters”.
  • Issue 3171, FirelightFlagboy, 2026-07-12: “Cannot remove temporary file during cdk8s import”.

These are issue-title reports from the project issue index, not verified fixes or deployment trials. They support inspecting generated names and treating import/synthesis as separate checks. Evidence for a successful CDKTF-to-cdk8s migration: none found.

Recommendation by constraint

Solo developer with a Kubernetes app: cdk8s if TypeScript reuse is worth the extra build step. Small team: cdk8s for workloads, with a separately owned cloud provisioning tool. Enterprise: reject new CDKTF adoption without an owned maintenance plan; keep Terraform state migration separate from manifest generation. If the requirement is general cloud provisioning rather than Kubernetes YAML, neither option is the default new supported solution in this comparison.

Prompt for your agent

List resources as cloud infrastructure or Kubernetes objects. For the Kubernetes subset, scaffold a cdk8s TypeScript chart, generate YAML and show assertions over its names and spec. Do not deploy. For existing CDKTF, inventory providers and state ownership before proposing an export plan.

Mistakes

Do not confuse AWS CDK with CDKTF, expect cdk8s synthesis to deploy, or let two tools own the same resource. Do not label an archived project's last release as actively supported.

Limits

No synthesis or deployment was executed. Exact stable patches and CLI/core compatibility were not confirmed. The two community reports were available only as issue-index titles; neither establishes a general reliability or performance conclusion. This recipe does not validate cloud costs, Terraform state moves or Kubernetes admission policies.

Started from a post by @HashiCorp, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Kubernetes with TypeScript: cdk8s or Terraform CDKTF?
Summary: As of October 2026, avoid new CDKTF deployments because HashiCorp ended support; use cdk8s for Kubernetes manifests, keep cloud provisioning separate, and generate manifests with `cdk8s synth`.
Copy for agent
get the whatworks thread typescript-infrastructure-cdktf-or-cdk8s and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread typescript-infrastructure-cdktf-or-cdk8s
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp