Flux Schema Config

Official Flux CLI plugin documentation.

The flux schema validate and flux schema explain commands can load default flag values from a YAML configuration file. The file shape is versioned and documented by the JSON Schema in config-v1beta1.json.

Example

apiVersion: schema.plugin.fluxcd.io/v1beta1
kind: Config
validate:
  schemaLocation:
    - ecosystem
  skipKind:
    - source.toolkit.fluxcd.io/v1/ExternalArtifact
  skipJSONPath:
    - Secret:/sops
  skipFile:
    - '.*'
    - kustomization.yaml
  skipCELRules: false
  skipMissingSchemas: false
  verbose: true
  failFast: false
  concurrent: 8
  insecureSkipTLSVerify: false
  output: text
explain:
  schemaLocation:
    - ecosystem
  apiVersion: v1
  recursive: false
  insecureSkipTLSVerify: false
  output: plaintext

Usage:

flux schema validate ./manifests --config .fluxschema.yml
flux schema explain pods.spec --config .fluxschema.yml

When --config is not set, the FLUX_SCHEMA_CONFIG environment variable is used. When neither is set, validate uses the executable-adjacent config file when it exists. explain reads that same path when no --schema-location is passed, for example ~/.fluxcd/plugins/flux-schema.config.

Specification

FieldDescription
apiVersionConfig API version. Currently schema.plugin.fluxcd.io/v1beta1.
kindConfig API kind. Currently Config.
validateDefaults for validation options.
explainDefaults for explain options.

Validation

The validate section configures defaults for the flux schema validate flags.

FieldDescription
schemaLocation[]Schema URLs, file paths, or templates tried in order. Aliases: default (built-in catalog), ecosystem ( schemas.fluxoperator.dev).
skipMissingSchemasSkip documents for which no schema can be found.
skipKind[]Kind or apiVersion/kind patterns excluded from validation.
skipJSONPath[]JSON Pointers stripped before validation.
skipFile[]Basename glob patterns excluded from validation.
skipCELRulesDisable evaluation of x-kubernetes-validations CEL rules.
verbosePrint a line for every document, including valid and skipped.
failFastExit after the first invalid document.
concurrentNumber of concurrent validation workers.
insecureSkipTLSVerifyDisable TLS certificate verification when downloading schemas.
outputOutput format: text, json, or yaml.

When the output field is set to json or yaml, the result has the Report API shape.

Explain

The explain section configures defaults for the flux schema explain flags.

FieldDescription
schemaLocation[]Schema URLs, file paths, or templates tried in order. Aliases: default (built-in catalog), ecosystem ( schemas.fluxoperator.dev).
apiVersionAPI group/version to explain by default.
recursivePrint fields of fields.
insecureSkipTLSVerifyDisable TLS certificate verification when downloading schemas.
outputOutput format: plaintext or plaintext-openapiv2.