Skip to content

add values.schema.json for values validation - #516

Open
ChinmayPande48 wants to merge 2 commits into
qdrant:mainfrom
ChinmayPande48:feat/add-values-schema-json
Open

ChinmayPande48 wants to merge 2 commits into
qdrant:mainfrom
ChinmayPande48:feat/add-values-schema-json

Conversation

@ChinmayPande48

Copy link
Copy Markdown
Contributor

Summary

Adds charts/qdrant/values.schema.json so user-provided values are validated on helm install, helm upgrade, helm template and helm lint. It also gives IDEs schema-based completion and hints for values.yaml.

Closes #513

What's covered

  • All top-level keys in the current values.yaml, with types for scalars, arrays and maps.
  • Enums where Kubernetes defines a fixed set: image.pullPolicy, service.type, port protocol, ingress pathType, PVC accessModes, podManagementPolicy, fsGroupChangePolicy, podDisruptionBudget.unhealthyPodEvictionPolicy.
  • Port ranges (1-65535) for service ports, servicePort and config.cluster.p2p.port.
  • apiKey / readOnlyApiKey accept a boolean, a string, or a valueFrom.secretKeyRef object, matching the documented options.
  • snapshotRestoration.snapshots allows null, since the default is an empty key.
  • targetPort, servicePort and PDB maxUnavailable / minAvailable accept int or string (named ports, percentages).
  • Options that are only commented out in values.yaml (e.g. terminationGracePeriodSeconds, minAvailable, storageClassName) are included.

Design decisions

  • Not strict. There is no additionalProperties: false, so existing users with extra or custom keys won't see installs break. It can be tightened later if maintainers want that.
  • Free-form Kubernetes objects (affinity, resources, lifecycle, sidecarContainers, volume lists, etc.) are typed only as object / array rather than reproducing the full Kubernetes schemas.
  • config is loosely typed. Only the keys already in values.yaml are typed and the object stays open.

Testing

  • Default values.yaml validates against the schema with no errors.
  • helm lint passes on the chart.
  • Invalid values are rejected, e.g. --set replicaCount=abc and --set image.pullPolicy=Sometimes.
  • Valid variants are accepted: string apiKey, apiKey via valueFrom.secretKeyRef, PDB maxUnavailable: "50%".

Happy to extend or tighten it, or add CI values files that exercise it, if you'd like.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add values.schema.json to the Qdrant Helm chart for Helm values validation

1 participant