Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature gates

Features that aren’t stable yet can be turned on and off one at a time. Each one has a name and a stage:

  • alpha: off by default. It can change or go away in any release.
  • beta: on by default, and it only changes by adding things. You can still turn it off.
  • GA: always on. Naming it still works, but turning it off is an error.
  • removed: an alpha feature that didn’t work out. Naming it prints a warning and does nothing.

Turning features on and off

$ kubecfg show --features=yakl app.yakl
$ kubecfg show --features=yakl,overlay app.yakl --overlay-code-file prod.yakl
$ kubecfg show --features=yakl --features=overlay app.yakl     # same as above
$ kubecfg show --features=yakl=false app.yakl                  # turn a feature off

KUBECFG_FEATURES=yakl,overlay does the same as the flag. If both are set, the flag wins.

--alpha (or KUBECFG_ALPHA=true) turns on every alpha feature, including ones that future releases add. A feature named in --features beats --alpha, so --alpha --features=httpd=false turns on every alpha feature except httpd. Prefer naming the features you use: upgrading kubecfg then can’t turn on something new.

An unknown name is an error, so a typo doesn’t leave a feature off without telling you.

Seeing what’s on

kubecfg features lists every feature, whether it’s on, and what turned it on or off:

$ kubecfg features --alpha --features=httpd=false
NAME              STAGE  DEFAULT  ENABLED  SOURCE      SINCE
eval              alpha  off      on       --alpha     v0.40.0
traceback         alpha  off      on       --alpha     v0.40.0
pack              alpha  off      on       --alpha     v0.40.0
httpd             alpha  off      off      --features  v0.40.0
...

kubecfg features -o json gives the same as data.

All features

NameStageSinceWhat it turns on
evalalphav0.40.0the eval command
tracebackalphav0.40.0the traceback command
packalphav0.40.0the pack command
httpdalphav0.40.0the httpd command
overlayalphav0.40.0–overlay-code, –overlay-code-file (and the deprecated –overlay)
yaklalphav0.40.0YAML with Jsonnet expressions: .yakl files, yakl: imports, yaklfmt, eval -o jsonnet
kustomize-importalphav0.40.0kustomize+https:// imports
pinned-importsbetav0.42.0#hash= on an import URL: the import fails if the content doesn’t match the hash
binary-importremovedv0.41.0the binary:// import prefix; use importbin