Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Schema Validation for Helm #4093

Open
igooch opened this issue Jan 21, 2025 · 0 comments
Open

JSON Schema Validation for Helm #4093

igooch opened this issue Jan 21, 2025 · 0 comments
Assignees

Comments

@igooch
Copy link
Collaborator

igooch commented Jan 21, 2025

Note

Milestone of #3766

Introduction

As part of Agones in-place upgrades we identified adding JSON schema validation as a step in validating an Agones upgrade #3766. The goal of this validation is to make any breaking changes in the Helm chart immediately apparent to the user.

JSON schema validation will validate the Agones Helm chart .Values object (note that this is not the values.yaml file itself. Details are in the Helm documentation on JSON schema files). Validation only applies to the helm install or helm upgrade, and not a direct kubectl install of the values.yaml file.

Critical User Journey

  1. An Agones release has a breaking change. For example foo.bar moves to foo.controller.bar.
  2. User does not read the documentation about the breaking change, and applies helm upgrade --install agones --version=$NewRelease with their current chart configuration of --set foo.bar=baz.
  3. Before the new release is installed by Helm, the validation of the Helm .Values object fails with error similar to Error: validation failed foo.controller.bar is required.
  4. User makes changes suggested by the Helm error, and successfully re-applies helm upgrade with --set foo.controller.bar=baz.

Design Overview

Goals

  • Validation only applies to Agones Helm installations or upgrades.
  • Validate that all values required for an Agones installation are present.
  • Validate that all values are of the correct type.
  • Validate that there are no unknown given values. (Attempting to set a value at a path that does not exist.)
  • The validation only applies to a specific chart version. I.e. the JSON schema validation for chart 1.46 is only applied to 1.46 and not 1.45 or 1.47.

Non-Goals

  • Validating configurations. JSON schema does basic validation of Helm chart values (required field is present, value is of the correct type, etc.), but is not sophisticated enough to handle configuration versions.
  • Non-Helm Agones installations or upgrades.

Future Goals

Core Changes Required

Create a new values.schema.json in agones/helm/install/agones.

Testing

  • Add a new CI / CD test using helm lint to validate the standard Helm installation.
    • Possible alternatives: helm template --debug or helm upgrade --install --dry-run --debug

Documentation

@igooch igooch self-assigned this Jan 21, 2025
@igooch igooch changed the title JSON schema for helm JSON Schema Validation for Helm Jan 21, 2025
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

No branches or pull requests

1 participant