kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
181 stars 30 forks source link

Spike: about how to convert all weaveworks Rego policies #766

Open flavio opened 2 weeks ago

flavio commented 2 weeks ago

Spike: about how to convert all these policies to Kubewarden

Define:

viccuad commented 1 week ago

Weaveworks uses the docker image weaveworks/polctl for automation on auto-generating, testing, documenting, and releasing the policies, repo here.

The repo uses openpolicyagent/opa to test the policies. Since we already use opa to build as a wasm target, I find it a good compromise to keep that workflow.

Weavework policies are marked with spec.standards. The list of available standards are in ./standards (example), and the policies have spec.standards. For now, transform these into metadata.annotations.

The policies are Rego gatekeeper policies.

Acceptance criteria

The end result is a forked monorepo with the following format:

$ tree
.
├── LICENSE
├── artifacthub-repo.yml
├── policy1/
│   └── 0.1.0/
│       ├── README.md
│       ├── tests/
|       │   └── deployment.yaml
│       ├── policy.rego
│       ├── Makefile
│       ├── metadata.yml
│       └── artifacthub-pkg.yml
└── policy2/
    ...

Example for one policy in https://github.com/viccuad/rego-policies.

For that:

Unresolved