Skip to content

Action — kubeconform ​

Validates Kubernetes manifests with kubeconform: the files of a directory, and what Helm charts and kustomizations render to. Optionally fails on a built-in API a target Kubernetes version no longer serves, and validates CRDs against the Datree CRDs-catalog (cert-manager, Traefik, etc.).

Usage ​

yaml
steps:
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

  - uses: KevinDeBenedetti/github-workflows/.github/actions/kubeconform@v0.57.0 # x-release-please-version
    with:
      paths: kubernetes/

Inputs ​

InputTypeDefaultDescription
pathsstringkubernetes/Directory containing Kubernetes manifests; empty validates only what is rendered
kubernetes-versionstring''Kubernetes version of the schemas (1.33 or 1.33.2); empty is kubeconform's default, the latest
helm-chartsstring''Charts to render with helm template, one per line: the chart's directory, then its values files
kustomizationsstring''Kustomization directories to render with kustomize build, one per line
deprecated-api-versionstring''Kubernetes version to check for removed APIs; empty runs no check
excludestring.*-values\.yamlRegex passed to -ignore-filename-pattern to exclude files
include-crds-catalogstring'true'Validate CRDs against the Datree CRDs-catalog
ignore-missing-schemasstring'false'Skip validation for resources whose schema is not found (e.g. custom CRDs not in the catalog)

Steps ​

  1. Install the pinned kubeconform with install-tool, and helm or kustomize when helm-charts or kustomizations is set
  2. Render each chart (helm template) and each kustomization (kustomize build) into $RUNNER_TEMP/kubeconform-rendered
  3. Run kubeconform -strict -summary on the manifests under paths (excluding files matching exclude) and on the rendered files
  4. With deprecated-api-version, run kubeconform again against that version's built-in schemas, and fail on each resource of a built-in API group it has no schema for

Notes ​

  • Run in strict mode — any unknown field causes a validation failure.
  • include-crds-catalog: true (default) adds the Datree CRDs-catalog as an extra schema source, enabling validation of common CRD types beyond the built-in Kubernetes schemas.
  • Helm values files (*-values.yaml) are excluded by default since they are not valid Kubernetes manifests.
  • A chart's release name is its directory name. Paths with spaces are not supported in helm-charts and kustomizations.
  • The removed-API check does not report a CRD without a schema: only the API groups Kubernetes itself serves count.
  • The script is kubeconform.sh; its tests are in tests/kubeconform.bats.