Skip to content

CI — Kubernetes

Validates Kubernetes manifests with kubeconform and optionally checks .env.example completeness. Supports the Datree CRDs-catalog for CRD-backed resources (cert-manager, Traefik, …).

Usage

yaml
jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-kubernetes.yml@main
    with:
      kubeconform-paths: kubernetes/
      kubeconform-include-crds-catalog: true

Inputs

InputTypeDefaultDescription
run-kubeconformbooleantrueValidate Kubernetes manifests with kubeconform
kubeconform-pathsstringkubernetes/Directory containing manifests to validate
kubeconform-excludestring'.*-values\.yaml'Filename pattern to exclude from validation
kubeconform-include-crds-catalogbooleantrueAlso validate against the Datree CRDs-catalog (cert-manager, Traefik, …)
kubeconform-ignore-missing-schemasbooleanfalseSkip resources with no schema in any configured location (custom CRDs)
run-env-examplebooleanfalseCheck that .env.example contains all required keys
env-example-required-keysstring''Space-separated list of keys that must be present in .env.example
env-example-filestring.env.examplePath to the .env.example file
runnerstring'"ubuntu-latest"'Runner labels as JSON — '"ubuntu-latest"' or a label array

Steps

  1. (kubeconform, if run-kubeconform) Checkout → run the kubeconform action over kubeconform-paths
  2. (env-example, if run-env-example) Checkout → verify every key in env-example-required-keys is present in env-example-file

Notes

  • The two jobs are independent: kubeconform is gated by run-kubeconform, env-example by run-env-example.
  • Enable kubeconform-ignore-missing-schemas for custom CRDs not in the catalog (e.g. Tetragon TracingPolicy, Kyverno ClusterPolicy).
  • The .env.example check fails listing any missing keys (matched as ^KEY=).