Linux command
kube-linter 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Lint Kubernetes manifests
kube-linter lint [path/to/manifests]
Lint Helm chart
kube-linter lint [path/to/chart]
List available checks
kube-linter checks list
Lint with specific checks
kube-linter lint --include [no-read-only-root-fs] [path]
Exclude checks
kube-linter lint --exclude [run-as-non-root] [path]
Output as JSON
kube-linter lint --format json [path]
说明
kube-linter analyzes Kubernetes YAML files and Helm charts for security and best practices. It catches misconfigurations like missing security contexts, resource limits, and privilege escalation risks. The tool is designed for CI/CD integration, helping catch issues before deployment.
参数
- lint _path_
- Lint manifests or charts.
- checks list
- List available checks.
- --include _checks_
- Only run specified checks.
- --exclude _checks_
- Skip specified checks.
- --config _file_
- Configuration file.
- --format _format_
- Output format: plain, json, sarif.
- --fail-on-invalid-resource
- Fail on invalid YAML.
FAQ
What is the kube-linter command used for?
kube-linter analyzes Kubernetes YAML files and Helm charts for security and best practices. It catches misconfigurations like missing security contexts, resource limits, and privilege escalation risks. The tool is designed for CI/CD integration, helping catch issues before deployment.
How do I run a basic kube-linter example?
Run `kube-linter lint [path/to/manifests]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does lint _path_ do in kube-linter?
Lint manifests or charts.