Write a Kyverno policy to validate, mutate, and generate resources, and review policy reports

domain: kyverno.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Author a Kyverno ClusterPolicy with a validate rule that denies images from untrusted registries
  2. Add a mutate rule to the same or a separate policy to inject a required label or annotation on all new pods
  3. Add a generate rule to automatically create a default NetworkPolicy in each new namespace
  4. Apply the policy to the cluster and confirm Kyverno webhook is active
  5. Inspect PolicyReport and ClusterPolicyReport resources to review pass/fail results for existing workloads
  6. Iterate on the policy rules based on report findings before switching validation rules to enforce mode

Known gotchas

Related routes

Author a Kyverno ClusterPolicy with mutate rules to inject resource limits and requests on pods that omit them, and validate the policy with Kyverno CLI test cases
kyverno.io · 5 steps · unrated
Create a Kyverno mutate policy to add a default resource limits sidecar annotation to Deployments
kyverno.io · 6 steps · unrated
Write a Kyverno mutate policy to inject a sidecar container into Deployments
kyverno.io · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans