How qbec evaluates component code using jsonnet and what it expects the output to look like.
.yamlfile directly under the component directory as a component to be loaded. In this case, the component name is the file name without the extension.
index.yamlfile. If so, create a component with the sub-directory name.
index.jsonnetfile exists load it for component processing
index.yamlfile exists load all
.yamlfiles in the subdirectory.
This works as follows:
c3.yamlevaluate each file in its own VM in parallel upto a specific concurrency.
The YAML file is parsed as:
The JSON file is parsed as:
The JSONNET is evaluated in a VM instance as-is. In this case:
qbec.io/envextension variable is set to the environment name in question.
qbec.io/envPropertiesextension variable is set to the properties defined for the environment.
qbec.io/tagextension variable is set to the
--app-tagargument passed to the command line (or the empty string, if it wasn’t)
qbec.io/defaultNsvariable is set to the default namespace for the environment. This is typically the namespace defined in the
qbec.yamlfile for the environment. If the
qbec.yamlis set to
--app-tagargument was specified for the command, the namespace from
qbec.yamlis suffixed with the tag with a hyphen in between.
qbec.yamlbut not specified on the command line are set.
The evaluation above creates a map of component names to outputs returned by the jsonnet, json and yaml files.
The output is allowed to be:
Listand it has an
itemsarray attribute containing an array of outputs.
In the latter 3 cases, the output is processed recursively to get to the leaf k8s objects.