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

Cfg

Display and modify JSON or YAML configuration

Reads From Writes To
local files or stdin local files or stdout

The cfg command group contains subcommands which read and write local YAML files. They are focused on providing porcelain on top of workflows which would otherwise require viewing and editing YAML directly.

Many cfg subcommands may also read from STDIN, allowing them to be paired with other tools such as kubectl get.

kpt cfg [SUBCOMMAND]

Examples

# print the package using tree based structure
$ kpt cfg tree helloworld --name --image --replicas
helloworld
├── [deploy.yaml]  Deployment helloworld-gke
│   ├── spec.replicas: 5
│   └── spec.template.spec.containers
│       └── 0
│           ├── name: helloworld-gke
│           └── image: gcr.io/kpt-dev/helloworld-gke:0.1.0
└── [service.yaml]  Service helloworld-gke
#  list available setters
$ kpt cfg list-setters helloworld replicas
    NAME          DESCRIPTION        VALUE    TYPE     COUNT   SETBY
  replicas   'helloworld replicas'   5       integer   1

# set a high-level knob
$ kpt cfg set helloworld replicas 3
set 1 fields

Annotate

Set an annotation on one or more resources

Cat

Print the resources in a package

Count

Print resource counts for a package

Create-setter

Create a setter for one or more field

Create-subst

Create a substitution for one or more fields

Delete-setter

Delete a setter

Delete-subst

Delete a substitution

Fmt

Format configuration files

Grep

Filter resources by their field values

List Setters

List setters for a package

Set

Set one or more field values

Tree

Render resources using a tree structure