k8wiz
Kyverno
Medium
Security

A Kyverno DeletingPolicy for ConfigMaps never deletes anything, and the cleanup controller logs 'skipping resource due to access restrictions'. What is missing?

Select your answer:

Show answer and explanation

Answer: List and delete RBAC for the cleanup controller's service account

Explanation

The cleanup controller lists and deletes resources with its own service account, and a forbidden error on the list is treated as permanent, so it skips that resource type and only logs the message. Grant the verbs in a ClusterRole labeled rbac.kyverno.io/aggregate-to-cleanup-controller: "true", which the chart's aggregated role picks up. Operations are not checked during a deletion scan, so adding DELETE changes nothing.

Read more about Kyverno