Lesson 16 Chart Validation & Linting
Theme:

Homework

Apply validation and linting skills to a realistic chart with comprehensive schema enforcement.

Submission: For each task, include the files you created or modified and screenshots of command output showing successful validation (or expected failures). Be prepared to walk through your schema design decisions in class.

Task 1 — Comprehensive values.schema.json

Create a new Helm chart (helm create webapp) and write a values.schema.json that enforces all of the following constraints:

After writing the schema:

  1. Run helm lint . with the default values.yaml — fix any issues until it passes
  2. Create a test-bad-values.yaml with at least 5 distinct schema violations and verify they are all reported

Self-check

Task 2 — Full Validation Pipeline Script

Write a shell script called ci-validate.sh that implements the complete validation pipeline for any chart directory passed as an argument:

  1. Stage 1: helm lint --strict
  2. Stage 2: helm template renders without errors
  3. Stage 3: kubeconform -strict validates rendered YAML against a configurable Kubernetes version (default 1.29.0, overridable via K8S_VERSION environment variable)

Requirements:

Test the script against your Task 1 chart with both valid and invalid values.

Self-check

Task 3 — Error Catalogue

Create a document (text file or markdown) that catalogues at least 8 distinct Helm chart errors, organized by which tool catches them. For each error, provide:

Your catalogue must include at least two errors from each of these categories:

Self-check

Grading Rubric

Criterion Points Requirements
Task 1 — Schema completeness 30 All 8 constraints implemented; passes with valid values; rejects bad values with 5+ errors
Task 2 — Pipeline script 35 Three stages in order; fails fast; configurable K8s version; supports -f flag; tested both ways
Task 3 — Error catalogue 25 8+ errors; 2+ per category; each with code, tool, message, and fix
Code quality & presentation 10 Clean script; well-formatted schema; clear documentation