GitOps schema reference

Every field of every GitOps object kind with its type and default, the template functions, selector operators, limits, myrctl exit codes and the table of issue codes.

This page lists every field of the five object kinds that myriarchd reads from a Git repository, the template functions, the limits, and the codes under which validation reports problems. For the ideas behind the objects see the concepts. For the layout of a repository and the rules that apply to all objects see Git as the source of truth.

A test (TestGitOpsSchemaReference in internal/gitops) keeps this page complete: it fails if a field of the Go schema or an issue code of the validation packages is missing from the tables below, or if a table names something that no longer exists.

How to read the tables:

  • The first column is the full YAML path, relative to the object. A list is written with [], so spec.waves[].percent is the field percent of every element of spec.waves.
  • Type uses these names: string, int, bool, duration (a string in Go syntax such as 30s, 5m or 1h30m), list, map and object. A map of any is free-form: the contents are not checked against a schema.
  • Required means the object is invalid without the field. “conditional” is explained in the description.
  • Unknown fields are errors (unknown_field), except inside free-form maps.

Common fields

Every object has the same envelope, followed by the spec of its kind.

FieldTypeRequiredDefaultDescription
apiVersionstringyesnoneExactly myriarch.dev/v1alpha1. Anything else is unknown_api_version.
kindstringyesnoneOne of Fleet, Blueprint, RolloutPolicy, Executor, Inventory. Anything else is unknown_kind.
metadata.namestringyesnoneUnique per kind. A DNS label: lower-case letters, digits and -, 1 to 63 characters, starting and ending with a letter or digit (invalid_name). Two objects of one kind with the same name are duplicate_object.
metadata.descriptionstringnoemptyFree text, shown in the UI.
metadata.labelsmap of stringsnononeFree labels of the object. They are not used for matching. Templates can read the labels of the fleet as .fleet.labels.

Fleet

Assigns agents to a blueprint, parameters, a target collector version, an update executor and rollout policies. See Fleets.

FieldTypeRequiredDefaultDescription
spec.displayNamestringnoemptyName shown in the UI.
spec.priorityintno0The fleet with the highest priority wins when selectors overlap. Equal highest priorities leave the agent unassigned.
spec.selectorobjectnoemptyChooses the agents of the fleet. An empty selector matches every agent.
spec.selector.matchAttributesmap of stringsnononeExact equality for each key. All entries must hold.
spec.selector.matchExpressionslistnononeSet-based conditions. All must hold. See Selector operators.
spec.selector.matchExpressions[].keystringyesnoneA key of the attribute view. Server labels are labels.<key>.
spec.selector.matchExpressions[].operatorstringyesnoneIn, NotIn, Exists, DoesNotExist or Glob.
spec.selector.matchExpressions[].valueslist of stringsconditionalnoneRequired for In, NotIn and Glob. Must be empty for Exists and DoesNotExist.
spec.blueprintstringyesnoneName of the leaf blueprint to render (blueprint_not_found if it does not exist).
spec.parametersmap of anynononeValues for the blueprint parameters. A name the blueprint does not declare is unknown_parameter.
spec.collectorobjectnosee fieldsThe desired collector.
spec.collector.distributionstringnootelcol-contribThe collector distribution. Only otelcol-contrib is supported (invalid_field).
spec.collector.versionstringnoemptyThe Git target version, a semantic version without a leading v, for example 0.162.0. Empty means versions are not managed for this fleet (unless the UI chooses one, see spec.update.selection).
spec.updateobjectnosee fieldsHow collector versions are changed.
spec.update.executorstringnononenone, updater, webhook, awx or manual. See Executors. Any other value is executor_invalid.
spec.update.executorRefstringconditionalemptyName of an Executor object. Required for webhook and awx (the type must match). For the other executors it is ignored with a warning.
spec.update.paramsmap of anynononeFree parameters passed to the executor, for example in the webhook payload.
spec.update.selectionobjectnoabsentThe frame within which the UI may choose the target version. Absent means disabled. See Target version from the UI.
spec.update.selection.enabledboolnofalseAllows UI and API updates. Requires an executor other than none.
spec.update.selection.versionRangestringconditionalnoneA semantic version constraint (Masterminds semver v3) over versions without v, for example ">=0.161.0, <=0.162.0". With enabled: true exactly one of versionRange and versions is required.
spec.update.selection.versionslist of stringsconditionalnoneAn explicit list of selectable versions, strict semantic versions without v, each once.
spec.update.selection.allowDowngradeboolnofalsefalse allows only versions greater than or equal to the current effective target.
spec.update.selection.requireReasonboolnofalseA reason is mandatory when choosing and when taking a choice back.
spec.update.selection.rolloutPolicystringnospec.rollout.versionPolicy, else defaultThe policy for rollouts that a UI choice causes.
spec.rolloutobjectnosee fieldsThe rollout policies of the fleet.
spec.rollout.configPolicystringnodefaultName of the RolloutPolicy for configuration changes.
spec.rollout.versionPolicystringnodefaultName of the RolloutPolicy for version changes.
spec.bridgeobjectnosee fieldsHow the fleet treats OpAMP Bridge agents of the OpenTelemetry Operator that its selector matches. See Bridge agents.
spec.bridge.manageboolnofalseAvailable from v0.2.0. Opts the fleet in to configure the Bridge agents that its selector matches. Without it a Bridge never receives remote configuration from the fleet, and a selector that matches Bridges is the warning bridge_selected. The opt-in takes effect for Bridges in standalone mode only: a Bridge in operator mode stays locked with it. The server enforces this: without the opt-in no remote configuration is offered to a Bridge (see Bridge agents), and with it the restart command and version rollouts stay off.

A policy name that is not default and does not exist is policy_not_found. If the policy default does not exist, the built-in policy applies (Rollouts).

Blueprint

A layered, parameterized collector configuration. See Blueprints.

FieldTypeRequiredDefaultDescription
spec.extendsstringnoemptyName of the parent blueprint. Single inheritance. A cycle is extends_cycle, a missing parent blueprint_not_found.
spec.parameterslistnononeTyped parameters. A child may declare a parent’s parameter again with the same type and replaces the declaration.
spec.parameters[].namestringyesnone^[a-zA-Z][a-zA-Z0-9_]*$, unique within the blueprint. Used as .params.<name>.
spec.parameters[].typestringyesnonestring, int, number, bool, duration, list or map.
spec.parameters[].descriptionstringnoemptyFree text.
spec.parameters[].defaultanynononeThe value when no other source provides one. Must match the type.
spec.parameters[].requiredboolnofalseWhen true, rendering fails if no value results (missing_parameter).
spec.parameters[].enumlistnononeThe allowed values. Each entry must match the type.
spec.parameters[].patternstringnoemptyAn RE2 expression the whole value must match. Only for string.
spec.parameters[].minnumbernononeLower bound, inclusive. Only for int and number. Must not be greater than max.
spec.parameters[].maxnumbernononeUpper bound, inclusive. Only for int and number.
spec.parameters[].fromAttributestringnoemptyTakes the value from this key of the agent’s attribute view if it exists, converted to the type.
spec.configmap of anynononeThe collector configuration tree. Strings may contain [[ ... ]]. Keys must not contain ::.
spec.fragmentslistnononeConditional overlays, merged in file order after spec.config.
spec.fragments[].namestringyesnone^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,62}$, unique within the blueprint.
spec.fragments[].whenstringnoemptyExactly one "[[ expression ]]" that evaluates to a bool. Empty means always.
spec.fragments[].configmap of anynononeThe overlay that is merged when the fragment is active.
spec.fragments[].removelist of stringsnononeConfmap paths removed after the overlay is merged.
spec.removelist of stringsnononeConfmap paths (receivers::host_metrics) removed after the blueprint’s config and fragments are merged. No templates, no empty segments.

The order of precedence for parameter values and the merge rules are explained in Blueprints.

RolloutPolicy

Controls how changes reach the agents of a fleet. See Rollouts.

FieldTypeRequiredDefaultDescription
spec.waveslistnoone wave all with 100 percentThe waves in order. If the last wave is a selector wave or below 100 percent, a final wave rest with 100 percent is appended.
spec.waves[].namestringyesnoneUnique within the policy.
spec.waves[].selectorobjectconditionalnoneThe wave takes all remaining targets that match. Exactly one of selector and percent is required.
spec.waves[].selector.matchAttributesmap of stringsnononeExact equality for each key, for example labels.wave: canary.
spec.waves[].selector.matchExpressionslistnononeSet-based conditions, as in a fleet selector.
spec.waves[].selector.matchExpressions[].keystringyesnoneA key of the attribute view.
spec.waves[].selector.matchExpressions[].operatorstringyesnoneIn, NotIn, Exists, DoesNotExist or Glob.
spec.waves[].selector.matchExpressions[].valueslist of stringsconditionalnoneAs for a fleet selector.
spec.waves[].percentintconditionalnone1 to 100. The wave grows the cumulative share of all targets to this percentage. Values must strictly increase from wave to wave.
spec.waves[].requireApprovalboolnofalseThe wave starts only after an operator approves it.
spec.maxConcurrentintno0 (unlimited)Targets in progress at the same time across the rollout. Negative values are policy_invalid. The built-in policy uses 50.
spec.healthWaitdurationno60sHow long a target must stay online and healthy after it reports success.
spec.applyTimeoutdurationno10m for configuration, 30m for versionsThe longest time from the start of a target until success is reported.
spec.offlineGracePerioddurationno15mHow long a wave waits for offline targets before it skips them.
spec.failureThresholdobjectnomaxFailed: 1When a wave counts as failed.
spec.failureThreshold.maxFailedintno0Absolute number of failed targets that triggers onFailure. If both values are 0, maxFailed is 1.
spec.failureThreshold.maxFailedPercentintno0Percentage of the wave’s targets, 0 to 100. If only this is set, only the percentage rule applies.
spec.onFailurestringnopausepause or rollback.
spec.maintenanceWindowslistnononeWindows in which targets may start. Empty means any time.
spec.maintenanceWindows[].dayslist of stringsnoevery dayWeekdays on which the window begins: Mon, Tue, Wed, Thu, Fri, Sat, Sun (case-insensitive).
spec.maintenanceWindows[].startstringyesnoneHH:MM, 24 hours. Quote it, so YAML does not read a number.
spec.maintenanceWindows[].endstringyesnoneHH:MM. If end is not later than start, the window crosses midnight. start equal to end is 24 hours.
spec.maintenanceWindows[].timezonestringnoagentagent uses the attribute named by timezoneAttribute. Otherwise an IANA zone name such as UTC or Europe/Amsterdam.
spec.timezoneAttributestringnosite.timezoneThe agent attribute that holds the IANA zone for windows with the timezone agent.
spec.defaultTimezonestringnothe server setting rollouts.defaultTimezone (UTC)The zone used when the agent has no valid zone attribute.

Negative durations are policy_invalid. The built-in policy used when no default object exists is described in Rollouts.

Executor

Describes an external update path for the executor types webhook and awx. The executors updater and manual need no object. See Executors.

FieldTypeRequiredDefaultDescription
spec.typestringyesnonewebhook or awx. The matching block must be present, the other must not.
spec.webhookobjectconditionalnoneRequired for the type webhook.
spec.webhook.urlstringyesnoneAn absolute http or https URL without credentials. The host must be in executors.allowedWebhookHosts of the server configuration.
spec.webhook.methodstringnoPOSTPOST, PUT or PATCH.
spec.webhook.headersmap of stringsnononeExtra headers. Not allowed: names with the prefix X-Myriarch-, and Authorization, Cookie, Proxy-Authorization, Host, Content-Length.
spec.webhook.secretEnvstringconditionalnoneName of the environment variable on the server that holds the HMAC secret. Exactly one of secretEnv and secretFile is required.
spec.webhook.secretFilestringconditionalnoneFile name below executors.secretDir with the HMAC secret.
spec.webhook.timeoutdurationno30sAt most 5m. The server may cap it further.
spec.webhook.batchSizeintno100Targets per call. Must not be negative.
spec.awxobjectconditionalnoneRequired for the type awx.
spec.awx.urlstringyesnoneThe AWX base URL, as for spec.webhook.url.
spec.awx.jobTemplateIdintyesnoneThe ID of the job template, a positive integer.
spec.awx.apiPrefixstringno/api/v2/The path of the controller API. Automation Platform 2.5 and later uses /api/controller/v2/. An absolute path of plain segments.
spec.awx.tokenEnvstringconditionalnoneName of the environment variable that holds the bearer token. Exactly one of tokenEnv and tokenFile is required.
spec.awx.tokenFilestringconditionalnoneFile name below executors.secretDir with the token.
spec.awx.limitAttributestringnohost.nameThe agent attribute used to build the AWX limit. Values must be plain host names.
spec.awx.extraVarsmap of anynononeVariables passed to the job. Strings may use [[ ... ]] with the executor context (.toVersion, .distribution, .fleet, .rolloutId, .wave, .hostnames, .params).
spec.awx.caFilestringnoemptyFile name below executors.secretDir with an additional CA certificate for AWX.
spec.awx.timeoutdurationno30sAt most 5m.
spec.awx.batchSizeintno100Hosts per job launch. Must not be negative.

Violations of these rules are missing_field (a required field or block is absent) or executor_invalid (a value is wrong). Which secret names the server may read is decided by its configuration, see Executors.

Inventory

Adds server labels and parameter overrides to agents that match exact attribute values. See Inventory.

FieldTypeRequiredDefaultDescription
spec.entrieslistnononeThe entries, applied in file order. Later matches override earlier ones, key by key.
spec.entries[].matchmap of stringsyesnoneAttribute keys and values. All must be equal. Must not be empty, and keys must not start with labels..
spec.entries[].labelsmap of stringsnononeServer labels to attach, addressed in selectors as labels.<key>. Keys must be non-empty and contain no space.
spec.entries[].parametersmap of anynononeParameter overrides for the blueprint. Undeclared names are ignored with a warning.

Sample agents

Files in samples/agents/*.yaml (or .yml) below the repository path describe example agents. They are not objects of myriarchd. myrctl validate and the server’s validation render every fleet for the sample agents that match it, and myrctl render --sample NAME renders for one of them. A file may contain several documents.

FieldTypeRequiredDefaultDescription
namestringyesnoneUnique among the samples (duplicate_object).
attributesmap of stringsnononeThe attributes of the agent, as it would report them. Values are kept as written.
labelsmap of stringsnononeServer labels, as they would come from an enrollment token. Inventory labels override them on equal keys.
name: linux-edge-01
attributes:
  service.name: otelcol-contrib
  os.type: linux
  host.name: linux-edge-01.example.com
  site.type: edge
  site.id: edge-001
  site.timezone: Europe/Amsterdam
labels: {}

Unknown fields in a sample are unknown_field, a value that is not a scalar is invalid_field. A sample that matches no fleet is the warning sample_unassigned. A sample that matches several fleets of equal highest priority is the warning fleet_ambiguous.

From v0.2.0 on, a sample that is an OpAMP Bridge, because it has the service.name io.opentelemetry.operator-opamp-bridge or the attribute opentelemetry.io/opamp.bridge.mode, is never rendered and does not have to match a fleet. For every matching fleet without spec.bridge.manage it is the warning bridge_selected, with the name of the sample. The quickstart examples contain no Bridge sample.

Selector operators

Used by spec.selector.matchExpressions of a fleet and by wave selectors of a policy.

OperatorMeaningvalues
InThe attribute exists and its value is one of values.required
NotInThe attribute is missing, or its value is not one of values.required
ExistsThe attribute exists.must be empty
DoesNotExistThe attribute is missing.must be empty
GlobThe attribute exists and matches at least one pattern. The syntax is the one of Go’s path.Match, for example edge-0*.required, valid patterns

All conditions of a selector, matchAttributes and matchExpressions together, must hold. An unknown operator, a missing key or missing values are selector_invalid.

Template functions

Templates use the delimiters [[ and ]]. In addition to the functions below, the Go builtins and, or, not, eq, ne, lt, le, gt, ge, len and index are available. The argument that is processed comes last, so pipes work: .params.x | default "y". The rules for evaluation and the limits are in Blueprints.

FunctionResultDescription
attr KEYstringThe attribute value. An error if the agent has no such attribute.
attrOr KEY DEFAULTstringThe attribute value, or DEFAULT if it does not exist.
hasAttr KEYboolWhether the attribute exists.
param NAMEanyThe value of the parameter. An error if it has no value.
default DEFAULT VALUEanyVALUE, unless it is empty (null, empty string, list or map, false or 0), then DEFAULT.
required MESSAGE VALUEanyVALUE, or an error with MESSAGE (shown for at most 200 characters) if it is empty.
lower S, upper S, trim SstringLower case, upper case, and trimmed white space.
trimPrefix P S, trimSuffix X SstringRemoves a prefix or a suffix.
replace OLD NEW SstringReplaces every occurrence. OLD must not be empty.
contains SUB S, hasPrefix P S, hasSuffix X SboolString tests. Lists and maps are compared as compact JSON.
join SEP LISTstringJoins the elements of a list.
split SEP SlistSplits a string. At most 10,000 parts.
list A B ...listA list literal. At most 10,000 elements.
dict K1 V1 K2 V2 ...mapA map literal. The keys must be strings.
int V, float V, bool Vint, number, boolConversions. int accepts an integer, a number (the fraction is cut off), a numeric string or a bool.
str VstringConverts to a string. Lists and maps become compact JSON.
add A B, sub A B, mul A B, div A BintInteger arithmetic. div by zero is an error.
toJson VstringThe JSON encoding of a value.
printf, print, println, html, js, urlquerystringThe Go functions of the same name, with bounded output. printf accepts widths and precisions up to 256, no * and no argument indexes.

The output of a function and of a template string is limited to 64 KiB. Further limits (range, compute time and the total amount of text a template may produce) are described in Blueprints.

Limits

LimitValueCode when exceeded
Size of one YAML file4 MiBfile_too_large
Number of YAML filesgitops.maxFiles, default 2000too_many_files
Total size of all YAML filesgitops.maxYamlBytes, default 64 MiBrepository_too_large
Size of the checked-out repositorygitops.maxRepoBytes, default 256 MiBthe fetch fails (sync_failed)
YAML nodes visited by the strict checks of one object500,000repository_too_complex
Time to parse and validate one revision on the server2 minutestime_budget_exceeded
Symbolic links and other non-regular filesnot allowednot_regular_file
Size of a rendered configuration1 MiBtemplate_error for the sample that renders it

myrctl applies the same file, count and node limits. It has no time budget.

Validation and issue codes

myrctl validate [DIR] (the default directory is .) validates the repository exactly as myriarchd does before it applies a revision, and renders every fleet for the matching sample agents. myrctl render prints the rendered configuration of one fleet for one agent. The flags are documented with the commands: myrctl validate and myrctl render.

Exit codes of both commands:

Exit codeMeaning
0The repository is valid. Warnings are allowed (with validate --strict they are not).
1Validation errors, or render errors.
2Usage or internal error, for example an unknown flag, a directory that does not exist, or an unknown --output.

Text output. Each finding is one line: file:line: severity code: message (Object/name, path). A summary line follows, for example OK: 1 Blueprint, 3 Fleet, ...; 4 samples; 0 errors, 0 warnings, or FAILED: ....

JSON output. myrctl validate --output json prints one object with the keys

  • valid: true when the exit code is 0,
  • errors and warnings: the number of findings of each severity,
  • objects: the number of objects per kind, for example {"Fleet": 3},
  • samples: the number of sample agents,
  • issues: the list of findings (never null).

Each finding has severity, code, message and, where known, file, line, path and object. This output fits annotations in CI systems. myrctl render --output json prints fleet, blueprint, layers, parameters, parameterSources (per parameter one of default, fleet, attribute, inventory or override), hash, config and issues.

myrctl validate --components FILE takes a component list (the format of examples/sim/components-otelcol-contrib-0.162.0.json) and enables the check unknown_component for all sample renderings. Without it, component names are not checked against a collector.

Issue codes. The codes are stable. The server shows the same codes in the UI and the API.

CodeSeverityMeaning
blueprint_not_founderrorA fleet names a blueprint that does not exist, or an extends parent is missing.
bridge_selectedwarningAvailable from v0.2.0. The selector of a fleet without spec.bridge.manage also matches an OpAMP Bridge agent: a synthetic Bridge in operator mode or in standalone mode (what the Bridge reports itself, with the inventory applied), or a sample agent that is a Bridge. The fleet would never configure it. Selectors on labels.* of an enrollment token cannot be evaluated here. With validate --strict the warning fails the check.
config_invalid_toplevelerrorThe rendered configuration is not a mapping, has a top-level key other than receivers, processors, exporters, connectors, extensions and service, or a section is not a mapping.
deprecated_componentwarningA component uses an old type name (an alias), for example hostmetrics.
duplicate_objecterrorTwo objects of one kind have the same name, two fragments of one blueprint, or two sample agents.
env_syntaxwarningAn unbalanced ${ or an unknown scheme in a ${...} expression of the rendered configuration.
executor_invaliderrorAn executor is wrong: URL, type, secret reference, header, method, timeout, block mismatch, or update.executor is not one of none, updater, webhook, awx, manual. As a warning: an executorRef that is ignored for updater and manual.
executor_not_founderrorupdate.executorRef names an executor that does not exist.
extends_cycleerrorThe extends chain of blueprints is a cycle.
file_too_largeerrorA YAML file is larger than 4 MiB.
fleet_ambiguouswarningA sample agent matches several fleets with the same highest priority.
invalid_component_iderrorA component id is not type[/name], or its configuration is not a mapping or null.
invalid_config_keyerrorA key in spec.config contains ::, the path separator of the collector’s confmap.
invalid_fielderrorA field has the wrong type or cannot be decoded, or a value is not allowed (distribution, collector version, remove path, label key, sample attribute).
invalid_nameerrorAn object name or a fragment name does not match its pattern.
invalid_parametererrorA parameter declaration is wrong: name, unknown type, default, pattern, min or max, enum entry, or a duplicate.
invalid_parameter_valueerrorA parameter value does not match its type or violates enum, pattern, min or max.
invalid_pipelineerrorservice.pipelines is missing or wrong: no pipeline, an invalid id, an unknown key, a missing or duplicated component list.
missing_fielderrorA required field or block is missing, or a document is not a mapping. As a warning: update.executor is set but collector.version is empty.
missing_parametererrorA required parameter has no value.
not_regular_fileerrorThe repository contains a symbolic link or another non-regular file.
parameter_type_conflicterrorA child blueprint declares a parameter again with a different type.
policy_invaliderrorA rollout policy is wrong: a negative number or duration, a threshold out of range, an unknown onFailure, or an invalid defaultTimezone.
policy_not_founderrorA fleet or a selection frame names a rollout policy that does not exist.
repository_too_complexerrorAn object has more YAML nodes than the strict checks accept.
repository_too_largeerrorThe YAML files exceed the total size limit.
sample_unassignedwarningA sample agent matches no fleet.
selection_invaliderrorspec.update.selection is wrong: no or both of versionRange and versions, an invalid constraint or version, executor none, or collector.version outside the frame. As a warning: a disabled block that still has a frame.
selector_invaliderrorA selector has an empty key, an unknown operator, missing or unexpected values, or an invalid glob pattern.
sync_failederrorThe server could not fetch or apply the repository. Recorded by the syncer, not by myrctl.
template_errorerrorEvaluating a template failed, or rendering a sample agent failed.
template_syntaxerrorA template does not parse, a when is not exactly one expression, or a construct is not allowed.
time_budget_exceedederrorParsing or validating one revision took longer than the time budget.
too_many_fileserrorThe repository has more YAML files than gitops.maxFiles.
undefined_componenterrorA pipeline or service.extensions refers to a component that is not defined.
unknown_api_versionerrorapiVersion is missing or not myriarch.dev/v1alpha1.
unknown_componenterrorA component type is not in the component list of the collector (after resolving aliases).
unknown_fielderrorA field is not part of the schema.
unknown_kinderrorkind is missing or not one of the five kinds.
unknown_parametererrorA fleet or a preview override sets a parameter that the blueprint does not declare. As a warning for inventory parameters, which are ignored.
unquoted_templateerrorA value [[ ... ]] is not quoted, so YAML read a nested list.
unused_componentwarningA component is defined but used in no pipeline and not in service.extensions.
wave_invaliderrorA wave is wrong: no name, a duplicate name, both or neither of selector and percent, a percent out of range or not increasing.
when_not_boolerrorThe when of a fragment does not evaluate to a boolean.
window_invaliderrorA maintenance window has an invalid time, weekday or time zone.
yaml_syntaxerrorA YAML file cannot be read or parsed, or a rendered configuration is not valid YAML.