Edna

Edna is a Kubernetes manifest linter. This project was built as a personal learning exercise to understand how linters work and is not intended for production use.
Overview
Installation
From GitHub Releases
Download the latest pre-built binary for your platform from the GitHub Releases page. Extract the archive, place the edna binary in your system PATH, and verify the installation:
edna version
Build from Source
Clone the repository and build the binary locally:
git clone https://github.com/patrikjokhel/edna.git
cd edna
make build
Place the resulting edna binary in your system PATH.
Using go install
Install the latest version directly via the Go toolchain:
go install github.com/patrikjokhel/edna@latest
Ensure your Go binary directory (default $(go env GOPATH)/bin) is added to your system PATH.
Getting Started
Edna provides a command-line interface to validate Kubernetes manifests and live cluster resources. The primary command is edna check, which supports three input modes:
Check Local Manifest Files
Validate individual YAML files or directories of manifests:
# Single file
edna check -f deployment.yaml
# Directory (recursive scan)
edna check -f ./manifests/
# Multiple files
edna check -f app.yaml -f service.yaml
Pipe output from kubectl or other tools directly into Edna:
kubectl get deployments -o yaml | edna check
cat deployment.yaml | edna check
Check Live Cluster Resources
Query resources directly from your active Kubernetes cluster:
# Check default namespace
edna check --cluster
# Check specific namespace
edna check --cluster -n production
By default, Edna outputs human-readable results. To retrieve results in JSON format, use the --json flag:
edna check -f deployment.yaml --json
Check the installed version of Edna:
edna version
Configuration
Edna supports configuration via .edna.yaml or .edna.yml placed in the working directory. The configuration file allows you to exclude files from scanning and customize rule behavior.
Excluding Files
Use the exclude key to specify file or directory patterns to skip during manifest scanning. Glob patterns are supported:
exclude:
- "vendor/"
- "*.generated.yaml"
Customizing Rules
The rules key is a map where each entry is keyed by the rule name (e.g., image-pull-policy). Each rule entry can have:
enabled: Set to false to disable the rule (defaults to true if omitted)
severity: Override the default severity with one of error, warning, or info
Example configuration:
exclude:
- "vendor/"
rules:
latest-tag:
enabled: false
image-pull-policy:
enabled: true
severity: error
For a full list of available rules and their names, see LINT_RULES.md.
Example Output
Running edna check against the sample manifests with lint violations produces output like the following:
edna check -f ./tests/testdata/
ERROR:
tests/testdata/latest-tag.yaml: default/Deployment/test-latest-tag: Image has latest or no tag: nginx:latest
tests/testdata/resource-balance.yaml: default/Deployment/test-resource-balance: Container 'nginx' has a lower memory limit (128Mi) set than requested (256Mi)!
tests/testdata/resource-balance.yaml: default/Deployment/test-resource-balance: Container 'nginx' has a lower cpu limit (100m) set than requested (200m)!
WARNING:
tests/testdata/image-pull-policy.yaml: default/Deployment/test-image-pull-policy: Image pull policy is not set to 'Always', but 'IfNotPresent'
tests/testdata/unused-labels.yaml: default/Deployment/test-unused-labels: Label 'unused-label:test' is unused
tests/testdata/unused-labels.yaml: default/Deployment/test-unused-labels: Label 'unused-label:test' is unused
tests/testdata/resource-request.yaml: default/Deployment/test-resource-request: Container 'nginx' has no CPU request set!
tests/testdata/resource-request.yaml: default/Deployment/test-resource-request: Container 'nginx' has no Memory request set!
tests/testdata/resource-limit.yaml: default/Deployment/test-resource-limit: Container 'nginx' has no CPU limit set!
tests/testdata/resource-limit.yaml: default/Deployment/test-resource-limit: Container 'nginx' has no Memory limit set!
Found 3 error(s), 7 warning(s), 0 info
LICENSE
Edna is licensed under the MIT license.