Glenr

reference

Values files

A file named values/<environment>.yaml, committed beside the glenr.yaml of a resource set, sets that environment's values and variables from your repository. A key the file states has one writer, the file.

values/production.yaml
glenr: values/v1
environment: production
values:
  size: small
  network.egress: declared
variables:
  LOG_LEVEL: info
apps:
  web:
    values:
      replicas: 3
      size: standard
    variables:
      FEATURE_X: "on"
  api:
    values:
      size: standard
      scale.min: 1
      scale.max: 5
      scale.cpu: 70

Path and first line

The path is values/<environment>.yaml, in the directory that holds the set's glenr.yaml. <environment> is the environment's name exactly. The file is read at the same commit as glenr.yaml.

The file must carry the top-level key glenr: values/v1(write it first, as in the example). A file without it is not a Glenr file: the plan skips it and says so in a note, so an unrelated file with the same name (a Helm values file, for example) is left alone. A file with the line is read, and every problem in it is refused.

Keys

KeyMeaning
glenrRequired. The value values/v1 is the one format this reader reads. Another value, such as values/v2, is refused and names values/v1.
environmentRequired. Must equal the file name: values/production.yaml says environment: production.
valuesA mapping of value keys to scalars, at the environment layer: size, network.egress and the other keys the Configuration page lists under Values. The rules for which key is legal where are the ones the console and the API apply.
variablesA mapping of variable names to string values, at the environment layer. The variable rules of the Configuration page apply, including the refusal of a name that is already a secret.
appsA mapping of resource names, each with its own values and variables. A name must be a resource this resource set declares. replicas belongs here, not at the environment layer. A web service takes replicas or an autoscale range, not both; the scale.* keys apply to web services only.
omittedAccepted and ignored. A file written by Export names the secrets it left out here, and reads back unchanged.

A value is a YAML scalar. Write it the way the API stores it (replicas: 3, storage: 20) or the way the console shows it (replicas: "3", storage: 20 GiB, scale.cpu: 70%).

What the reader refuses

InputResult
A top-level key other than the six above, in a file with the glenr lineRefused. The message lists the six keys.
secretsRefused. The message says to set secrets in Settings or through the API: a secret is never read from a repository.
A key starting with glenr.io/ or convoy-tech.com/Refused. Those are annotation keys of a Score file or glenr.yaml; the value is set by the value key (size, for example).
An environment: that differs from the file name, or is missingRefused, naming the file name.
An apps entry for a resource this set does not declareRefused, naming the resources the set declares, or the other set that owns the resource.
variables for a databaseRefused. A database takes no variables or secrets.
A key stated twice, a key that is an alias or a merge key, a value that is a list or a mappingRefused with the line number or the key.
A file with the glenr line that is larger than 64 KiBRefused with its size and the limit. A larger file without the line is skipped like any other file that is not Glenr's.

Templating (${…}) is not read. A file states one environment: there is no base file that applies to every environment.

Plan and apply

Plan changes on a resource set reads the file and adds a Values section: one row per key the file states or released, with what the environment holds now, what the file says, and the action (set, unchanged, released or refused). A refused row carries the API's sentence and blocks the apply. A commit that changes only a values file is a change the plan can apply.

The apply writes every key the file states, environment layer first, then each resource in name order. If a write is refused, the apply stops and the refusal names the keys written before it.

One writer per key

A key the file states is owned by the file. On the Configuration page and on a resource's Settings, the key reads Set in values/production.yaml with the commit, and its input is disabled. A change made through the API is refused with a sentence that names the file, because the next apply would overwrite it. To change the key, edit the file. To manage it in the console, remove it from the file and apply: the stored value stays, the claim is released, and the plan that applies it shows the key as released.

Keys the file does not state stay editable in the console and the API. An autoscale range is scale.min, scale.max and at least one of scale.cpu and scale.memory, written in one change.

Push rule

A push to a tracked branch applies the values and variables the file changes, at the resource level and at the environment level, in each environment that tracks that branch. It does not resize a disk. A pinned environment ignores pushes. The push receipt names each value it wrote with its old and new value; a variable is named without its value.

In the fileWhat the push does
A value or variable of a resource that has an instanceWrites it, through the same writers as Apply.
A value or variable of a resource with no instance yetLeaves it to the apply and says so.
A value or variable at the environment levelWrites it, through the same writers as Apply.
A database size in glenr.yamlWrites it, through the same writer as Apply, for a database that exists and whose size differs from the file.
A storage increaseNames it in the receipt and does not resize the disk. Apply it from the plan.
A key the file no longer statesReleases its claim. The stored value stays.
A refused row, or any other refusal on the plan, such as the quota check or a values file that cannot be readWrites no value and no database size. Apply holds them.
Two pushes that overlap or arrive out of orderPushes that write to one resource set and environment run one at a time. A step reads the branch head and plans the file again before it writes. An older commit writes nothing and says a later push will apply. A step that cannot read the head or plan again writes nothing.