Skip to content

ct template

Bundle and execute a .ct entrypoint, then print rendered manifests with release labels.

Terminal window
ct template my-release . --namespace production
ct template <name> <dir|repo> [flags]
ArgumentRequiredDescription
nameyesRelease name used for Release.name and injected labels.
dir|repoyesLocal project directory or GitHub source (for example github.com/cloudticon/my-app@v1.0).
FlagShortTypeDefaultDescription
--namespace-nstringDefault namespace for resources
--values-fstring(auto-detect)Path to values file (JSON or YAML)
--output-ostring"yaml"Output format: yaml or json
--setstringArrayOverride values inline (e.g. --set replicas=5)
--no-cacheboolfalseSkip cache and re-download remote source before rendering

When --values is not specified, CT looks for values files in order:

  1. values.json
  2. values.yaml
  3. values.yml

The first file found is used. Use --values to override this behavior.

ct template accepts both local directories and GitHub sources:

  • Local: ct template my-release . --namespace prod
  • Remote: ct template my-release github.com/cloudticon/my-app@v1.0 --namespace prod

Remote sources are cached in ~/.ct/cache/. Use --no-cache to force re-download.

Render YAML from local directory:

Terminal window
ct template my-release . --namespace production

Render as JSON:

Terminal window
ct template my-release . --namespace production --output json

Override values inline:

Terminal window
ct template my-release . --namespace production --set replicas=5

Explicit values file (multi-environment):

Terminal window
ct template my-release . --namespace staging --values values-staging.json

Render from GitHub source:

Terminal window
ct template my-release github.com/cloudticon/my-app@v1.0 --namespace staging

Force re-download remote source:

Terminal window
ct template my-release github.com/cloudticon/my-app@main --namespace prod --no-cache

Pipe rendered output to kubectl:

Terminal window
ct template my-release . --namespace production | kubectl apply -f -
ct template <name> <dir|repo>
├─ Resolve source (local path or GitHub source URL)
├─ Optionally invalidate source cache (--no-cache)
├─ Auto-detect or load values file
├─ Apply --set overrides on top of values
├─ Bundle main.ct (esbuild: TS → JS, resolve URL imports)
├─ Execute bundled JS in Goja runtime
├─ Collect emitted Kubernetes resources
├─ Inject release labels:
│ app.kubernetes.io/managed-by=ct
│ ct.cloudticon.com/instance=<name>
├─ Set namespace on resources (if --namespace provided)
└─ Print manifests to stdout (YAML or JSON)
  • ct apply — render and apply in one step
  • ct init — scaffold a new project