Skip to content

Implement Policy lifecycle reconcilers #1021

Open
@fabriziosestito

Description

@fabriziosestito

Description

Update the Kubewarden controller to manage (Cluster)PolicyRevision resources and handle policy lifecycle.

References

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions