Kapitan compiles an inventory
into plain YAML under compiled/ . The registry's compile diff action shows
a reviewer what a pull request changes in that YAML. It does not say
whether the change is allowed. A container that runs privileged or an
image on the tag latest is one line in the diff, and Kapitan compiles it
without an error. Kyverno as an admission controller can reject such an
object when it reaches the cluster, after the merge.
This post runs two policy tools on compiled/ in the pull request: the
Kyverno CLI with policies from
kyverno/policies , and conftest with
Rego rules of your own. It then installs Kyverno into a
kind cluster with the same policies and sends it the
same objects.
The project is
policy-checks
in kadet-hub/examples. Its check script runs the steps below on every
change and once a week, and fails when one of their results changes.
Two targets
The class web renders podinfo as a Deployment with a Service through
the kubernetes generator.…