Open
Description
Description
Update the Kubewarden controller to manage (Cluster)PolicyRevision resources and handle policy lifecycle.
References
- https://github.com/kubewarden/rfc/blob/main/rfc/0022-policy-lifecycle.md#policy-lifecycle
- https://github.com/kubewarden/rfc/blob/main/rfc/0022-policy-lifecycle.md#policy-status
- https://github.com/kubewarden/rfc/blob/main/rfc/0022-policy-lifecycle.md#the-policy-server-is-a-statefulset
Acceptance Criteria
- Implement controller logic to create PolicyRevisions when policies are created/updated
- Refactor the current code removing the Pod lifecycle reconciliation
- Move to a PolicyServer StatefulSet
- Propagate status conditions from PolicyRevisions to the parent Policy resources
- Update webhook configurations to point to the correct policy generation endpoints
- Implement phase management logic for policies (Pending → Active → Updating, etc.)
- Generate Kubernetes Events for policy status transitions
- Implement garbage collection for old PolicyRevisions
- Review the metrics. At the time of writing, we only have an
activation
metric that goes up every time a policy is activated. This could be the occasion to add meaningful metrics, for instance, Active, Pending, Updating, and Failed policies total count. - Revisit the grafana dashboard to add those metrics.
Testing
Reevaluate integration tests—are real cluster tests still necessary? Since we're no longer waiting for the Pod restart and are using PolicyRevision
for communication between the PolicyServer and the controller, perhaps we could mock the PolicyServer instead.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status