Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

Helm Kubeconform (with schema support)

v0.1.0

Helm Kubeconform (with schema support)

play

Helm Kubeconform (with schema support)

Generate manifests with `helm template` and run `kubeconform` on the results

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Helm Kubeconform (with schema support)

uses: shivjm/[email protected]

Learn more about this action in shivjm/helm-kubeconform-action

Choose a version

Helm Kubeconform Action

A flexible GitHub Action to validate Helm charts with Kubeconform.

Usage

Assuming you have a charts directory under which you have a set of charts and a schemas directory containing any custom resource schemas, like this:

charts
└───foo
│  ├───templates
│  └───tests
└───bar
│  ├───templates
│  └───tests
└───schemas

You can validate the charts in your workflow like this:

jobs:
    kubeconform:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 0

    - name: Generate and validate releases
      uses: shivjm/[email protected]
      with:
        additionalSchemaPaths: |
          schemas/{{ .ResourceKind }}.json
        chartsDirectory: "charts"

See action.yml for more information on the parameters.

Schemas

The default Kubernetes schema will always be automatically included. If you need to add custom schemas, additionalSchemaPaths should be a list of paths, one per line, in the format expected by Kubeconform. These are relative to the root of your repository.

Tests

Every chart subdirectory must have a tests subdirectory containing values files as you would pass to Helm. Each file will be passed on its own to helm template release charts/chart and the results will be validated by Kubeconform.

Strict Mode

Kubeconform will be run in strict mode. Pass strict: "false" to disable this.

Rationale

I needed an action to validate some Helm charts. nlamirault/helm-kubeconform-action doesn’t offer enough flexibility and downloads two Git repositories during execution. It was a good opportunity to try writing some bad Go and dip my toes into the world of writing GitHub Actions—specifically, a Docker container action.