Files
oam/knowledge base/kubernetes/kubeval.md
2024-04-12 20:17:28 +02:00

1.7 KiB

Kubeval

Deprecated

Check out kubeconform or other tools.

Validates one or more Kubernetes configuration files.

Table of contents

  1. TL;DR
  2. Usage
  3. Further readings
    1. Sources

TL;DR

# Installation.
asdf plugin add 'kubeval' && asdf install 'kubeval' '0.16.0'
brew tap 'instrumenta/instrumenta' && brew install 'kubeval'
docker run -v "${PWD}/dir:/dir" 'garethr/kubeval' 'dir/file.yaml'
scoop bucket add 'instrumenta' 'https://github.com/instrumenta/scoop-instrumenta' && scoop install 'kubeval'

# Usage.
kubeval 'manifest_file.yaml' || echo "Validation failed" >&2
kubeval <(helm template …)
kubeval <(kustomize build …)

Usage

$ kubeval 'my-invalid-rc.yaml' || echo "Validation failed" >&2
WARN - my-invalid-rc.yaml contains an invalid ReplicationController - spec.replicas: Invalid type. Expected: integer, given: string
Validation failed

Further readings

Sources