k8wiz
Kyverno
Hard
Generation

A new generate rule creates a NetworkPolicy in every Namespace. What makes Kyverno also create it in Namespaces that existed before the policy?

Select your answer:

Show answer and explanation

Answer: Setting generateExisting: true on the generate rule

Explanation

A generate rule normally fires on admission events, so Namespaces that already exist are skipped. With generateExisting: true, the background controller also processes the matching resources that exist when the policy is created. The field belongs under the rule's generate section; the spec-level version is deprecated. synchronize only controls whether Kyverno keeps generated resources in sync afterwards.