Konstraint is a tool to auto generate Kubernetes Gatekeeper constrainttemplate
resources by parsing the Rego files directly.
Install konstraint
using your preferred method.
go get github.com/xUnholy/konstraint
Use the CLI to generate Gatekeeper constrainttemplate
resources:
konstraint template -p example/ -l example/libs -o yaml
Alternatively run the CLI using a Docker image for CI/CD:
docker run --rm --workdir /tmp/workspace \
-v "$(pwd)":/tmp/workspace \
xunholy/konstraint:latest \
template -p example -l example/libs \
-o yaml