Test policies offline with gator
Test templates and constraints against fixtures without a cluster, so policy mistakes show up in CI before deploy.
gator test -f policy/ && gator verify ./suite
- tool
- opa-gatekeeper3 commands
More opa-gatekeeper commands
-
kubectl get constrainttemplates && kubectl get constraints -AShow all ConstraintTemplates and every constraint created from them in all namespaces.
-
kubectl get k8srequiredlabels <name> -o jsonpath='{.status.totalViolations} {range .status.violations[*]}{"\n"}{.kind}/{.name}: {.message}{end}'Read the violation count and offending resources from the constraint's audit status, no new scan needed.