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
| Name | Stage | Since | What it turns on |
|---|---|---|---|
eval | alpha | v0.40.0 | the eval command |
traceback | alpha | v0.40.0 | the traceback command |
pack | alpha | v0.40.0 | the pack command |
httpd | alpha | v0.40.0 | the httpd command |
overlay | alpha | v0.40.0 | –overlay-code, –overlay-code-file (and the deprecated –overlay) |
yakl | alpha | v0.40.0 | YAML with Jsonnet expressions: .yakl files, yakl: imports, yaklfmt, eval -o jsonnet |
kustomize-import | alpha | v0.40.0 | kustomize+https:// imports |
pinned-imports | beta | v0.42.0 | #hash= on an import URL: the import fails if the content doesn’t match the hash |
binary-import | removed | v0.41.0 | the binary:// import prefix; use importbin |