The premise of kubeval is that any interaction with Kubernetes goes via its REST API. Hence, you can use the API schema to validate whether a given YAML input conforms to the schema.
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz
tar xf kubeval-linux-amd64.tar.gz
sudo cp kubeval /usr/local/bin
sudo chmode +x /usr/local/bin/kubeval
kubeval additional-properties.yaml
kubeval --strict additional-properties.yaml
cat my-invalid-rc.yaml | kubeval
kubeval --kubernetes-version 1.16.1 base-valid.yaml
Kube-score analyses YAML manifests and scores them against in-built checks.
- Running containers as a non-root user.
- Specifying health checks for pods.
- Defining resource requests and limits.
kubectl krew install score
kube-score score base-valid.yaml
kube-score score base-valid.yaml --output-format ci