Skip to content

values.yaml JSON schema #9

@applejag

Description

@applejag

Based on conversation from #6 (comment)

Helm v3 has support for JSON schemas for its values.yaml. If we add this, we both get extra bit of validation, and for those who use a text editor with the YAML language server from Red Hat then they also get intellisense when editing.

Sometimes, a chart maintainer might want to define a structure on their values. This can be done by defining a schema in the values.schema.json file. /.../

This schema will be applied to the values to validate it. Validation occurs when any of the following commands are invoked:

  • helm install
  • helm upgrade
  • helm lint
  • helm template

https://helm.sh/docs/topics/charts/#schema-files

So in our values.yaml we have the following:

$schema: https://raw.githubusercontent.com/iver-wharf/wharf-helm/wharf-helm-v1.0.0/charts/wharf-helm/values.schema.json

nameOverride: ""
fullnameOverride: ""

global:
  url: wharf.example.org
  ## Used in RabbitMQ & Jenkins to multiplex jobs and messages on the same
  ## instances while keeping track of their origin.
  instanceId: dev
  ## This flag is forwarded to the frontend where it can be used to show
  ## slightly different styling depending on if it's for production or not.
  isProduction: false

web:
  ## Defaults to 1
  replicaCount: 1
# ...and the rest of the YAML file

We might want to autogenerate it though, preferrably by using the same info that helm-docs take use of, as this would otherwise require us to maintain two separate files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestprio/0Lowest priority. "Wishful thinking"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions