This is the documentation for version 0.39. For documentation on the latest version of kpt, please see


Generate, transform, and validate configuration files.
Configuration Read From Configuration Written To
local files or stdin local files or stdout

Functions are executables (that you can write) which accept a collection of Resource configuration as input, and emit a collection of Resource configuration as output.

Functions can be packaged as container images, starlark scripts, or binary executables.

Functions may be used to:

  • Generate configuration from templates, DSLs, CRD-style abstractions, key-value pairs, etc.– e.g. expand Helm charts, JSonnet, Jinja, etc.
  • Inject fields or otherwise modify configuration – e.g.add init-containers, side-cars, etc
  • Rollout configuration changes across an organization – e.g.similar to
  • Validate configuration – e.g.ensure organizational policies are enforced

Functions may be run at different times depending on the function and the organizational needs:

  • as part of the build and development process
  • as pre-commit checks
  • as PR checks
  • as pre-release checks
  • as pre-rollout checks


# run the function defined by as a local container
# against the configuration in DIR
kpt fn run DIR/ --image
# run the functions declared in files under FUNCTIONS_DIR/
kpt fn run DIR/ --fn-path FUNCTIONS_DIR/
# run the functions declared in files under DIR/
kpt fn run DIR/

Using Functions

The [catalog] documents config functions implemented using different toolchains like starlark, typescript, and golang.

Developing Functions

See the Functions Developer Guide for more on producing functions.

Language Documentation Examples
Typescript Typescript SDK examples
Go Golang Libraries example
Shell Use builtin shell functions example
Starlark Starlark SDK example

Next Steps


Auto-generating function pipelines for different workflow orchestrators


Locally execute one or more functions in containers


Specify a directory as an output sink package


Specify a directory as an input source package