K8s Kyverno Troubleshooting logo

K8s Kyverno Troubleshooting

Organization
k8s-servant
k8s-kyverno-troubleshooting

Use when Kyverno blocks, changes or fails to police resources in Kubernetes: "admission webhook \"validate.kyverno.svc-fail\" denied the request", "resource ... was blocked due to the following policies", "Policy ... failed" from a ValidatingPolicy, a policy that should block but only reports (Audit), PolicyReports with failures, a policy that is not Ready, mutate or generate rules that do nothing, UpdateRequests stuck, or "failed calling webhook" for kyverno when its pods are down. Covers ClusterPolicy and Policy (kyverno.io) and the CEL policies (policies.kyverno.io). Investigates with kubectl get, describe, events and logs, and proposes fixes. Reads first and asks before changing anything.

Overview

Publisherk8s-servant
Repositoryk8s-skills
Skill namek8s-kyverno-troubleshooting
Stars
36
Forks
7
Bundled files
3
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by k8s-servant on GitHub. Read the source before you install it.

Installation

Install the K8s Kyverno Troubleshooting AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-kyverno-troubleshooting
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/k8s-servant/k8s-skills.git /tmp/k8s-skills
mkdir -p .claude/skills
cp -r /tmp/k8s-skills/skills/k8s-kyverno-troubleshooting .claude/skills/k8s-kyverno-troubleshooting
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable K8s Kyverno Troubleshooting in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads K8s Kyverno Troubleshooting on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so K8s Kyverno Troubleshooting is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Kyverno troubleshooting

Find out why Kyverno denies, changes or does not police a resource, and propose a fix. Read first, ask before changing. Run the investigation commands freely. Run a command under an "Ask first" line only after the user approves that exact command; if your credentials do not allow it, give it to the user to run. Never run a "Proposed fix"; hand it to the user.

Kyverno runs as admission webhooks plus background controllers. Two policy families exist side by side:

  • ClusterPolicy and Policy (kyverno.io/v1): rules with validate, mutate, generate or verifyImages. Deprecated in Kyverno 1.19 and planned for removal in 1.20; the API server prints a deprecation warning for them.
  • CEL policies (policies.kyverno.io/v1): ValidatingPolicy, MutatingPolicy, GeneratingPolicy, DeletingPolicy, ImageValidatingPolicy, and their Namespaced* variants.

A policy is a cluster-wide guardrail someone chose on purpose. The usual fix is to make the resource comply, not to weaken the policy; changing or excepting a policy is a decision for its owners.

The commands use placeholders: my-namespace, my-app, my-policy and my-rule. Replace them with the real names. Never read Secrets (policies can reference them for image verification or context; read their names only).

When to use

  • Applying a manifest, a Helm install or a GitOps sync fails with a Kyverno denial.
  • A resource is admitted although a policy should have blocked it.
  • PolicyReports show FAIL results, or a policy is not Ready.
  • A mutate or generate rule does not change or create what it should.
  • Every create or update fails with failed calling webhook naming kyverno.

Hand-offs, by skill name. When the evidence points elsewhere, continue with that skill; if it is not installed, keep going with the steps here and tell the user which skill would help:

  • The Kyverno pods crash or stay Pending: k8s-workload-troubleshooting.
  • A different admission controller denies the request (Gatekeeper, a cloud policy add-on): k8s-gatekeeper-troubleshooting.

Investigate

Work through the steps in order. Stop when you have the cause and its evidence.

1. Read the denial the user got. It names the webhook, the policy and the rule: validate.kyverno.svc-fail (ClusterPolicy and Policy) or vpol.validate.kyverno.svc-fail (ValidatingPolicy). Rules that Kyverno generated for Deployments, StatefulSets, Jobs and similar from a Pod rule are named autogen-<rule> (autogen-cronjob-<rule> for CronJobs).

2. List the policies and their state.

bash
kubectl get clusterpolicies,policies -A
kubectl get validatingpolicies,mutatingpolicies,generatingpolicies,imagevalidatingpolicies
kubectl get namespacedvalidatingpolicies -A

3. Read the policy named in the denial: its match, its failure action, its rules.

bash
kubectl get clusterpolicy my-policy -o yaml
kubectl describe clusterpolicy my-policy
kubectl get validatingpolicy my-policy -o jsonpath='{.spec.validationActions}{"\n"}{.spec.matchConstraints}{"\n"}{.spec.validations}{"\n"}{.status}{"\n"}'

For ClusterPolicy and Policy, the failure action is validate.failureAction on each rule (Enforce blocks, Audit only reports), or the older spec.validationFailureAction. For a ValidatingPolicy it is spec.validationActions (Deny, Audit, Warn).

4. Read the policy reports for the resource: results of background scans and of admission in Audit mode.

bash
kubectl get policyreports -n my-namespace
kubectl get clusterpolicyreports
kubectl get policyreports -n my-namespace -o jsonpath='{range .items[*].results[?(@.result=="fail")]}{.policy}{" "}{.rule}{" "}{.message}{"\n"}{end}'
kubectl events -n my-namespace | grep -i policy

5. If Kyverno itself may be the problem, read its pods, its webhook configurations and its logs.

bash
kubectl get deployments,pods -n kyverno
kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurations | grep -i kyverno
kubectl logs -n kyverno deployment/kyverno-admission-controller --tail=100
kubectl get configmap kyverno -n kyverno -o jsonpath='{.data.resourceFilters}{"\n"}'

6. Open the matching reference and follow its steps:

What you seeReference
A denial, was blocked due to the following policies, Policy ... failed, a policy that should block but only reports, PolicyReport failuresreferences/validation.md
Mutations that do not happen, generated resources missing, UpdateRequests, cleanup policiesreferences/mutate-and-generate.md
failed calling webhook naming kyverno, a policy not Ready, namespaces Kyverno ignores, controllers downreferences/webhooks-and-controllers.md

Read the results

What the common findings mean (Kyverno 1.19):

  • admission webhook "validate.kyverno.svc-fail" denied the request: resource <Kind>/<ns>/<name> was blocked due to the following policies, followed by <policy>: and <rule>: <message>: a ClusterPolicy or Policy rule in Enforce mode failed. The message after the rule name is the policy's own text plus the path that failed (failed at path /spec/template/metadata/labels/...).
  • admission webhook "vpol.validate.kyverno.svc-fail" denied the request: Policy <name> failed: <message>: a ValidatingPolicy with Deny failed.
  • An autogen- rule name: the policy was written for Pods; Kyverno applies it to the pod template of the controller you applied.
  • Admitted, and a fail result in a PolicyReport: the rule runs in Audit (or a ValidatingPolicy with Audit): Kyverno reports and lets it through.
  • No report and no denial at all: the policy does not match the resource (kinds, namespaces, selectors), the namespace is in the resourceFilters of the kyverno ConfigMap (by default kube-system, kube-public, kube-node-lease and kyverno), or the policy is not Ready.
  • failed calling webhook "validate.kyverno.svc-fail" (or another kyverno webhook): the API server cannot reach Kyverno, and the webhook fails closed. Nothing about the resource is wrong.

State the cause in one sentence, then the evidence you saw (the denial or report, the policy and rule, its failure action, its match), then the proposed fix.

Proposed fix

Show each fix to the user before running it: what it changes and how to undo it. Make the resource comply: change it in its source (manifest, Helm values, GitOps repository), so the next apply passes. Changing a policy's failure action or match, adding a PolicyException, and touching Kyverno's webhook configurations or ConfigMap change what is enforced for everyone: never run them yourself; hand them to the policy's owners as proposed fixes and say why. Write each undo with the values you found.

Bring back a Kyverno admission controller that was scaled to zero (write the undo with the replicas you found):

Ask first: the agent runs this only after the user approves it.

bash
kubectl scale deployment/kyverno-admission-controller -n kyverno --replicas=1
# Undo: kubectl scale deployment/kyverno-admission-controller -n kyverno --replicas=0

For a resource that must not comply (a real exception), the policy's owners add a PolicyException. Exceptions are turned off by default in Kyverno and must be enabled first (--enablePolicyException); see references/validation.md.

Sources

Checked against the Kyverno 1.19 documentation and source (v1.19.2):

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the K8s Kyverno Troubleshooting AI skill do?

Use when Kyverno blocks, changes or fails to police resources in Kubernetes: "admission webhook \"validate.kyverno.svc-fail\" denied the request", "resource ... was blocked due to the following policies", "Policy ... failed" from a ValidatingPolicy, a policy that should block but only reports (Audit), PolicyReports with failures, a policy that is not Ready, mutate or generate rules that do nothing, UpdateRequests stuck, or "failed calling webhook" for kyverno when its pods are down. Covers ClusterPolicy and Policy (kyverno.io) and the CEL policies (policies.kyverno.io). Investigates with ku...

Why use K8s Kyverno Troubleshooting on TypingMind?

Because you install it once and use it with any model. K8s Kyverno Troubleshooting is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install K8s Kyverno Troubleshooting in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-kyverno-troubleshooting. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use K8s Kyverno Troubleshooting?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with K8s Kyverno Troubleshooting?

As many as you like. As long as a model supports skills, you can use K8s Kyverno Troubleshooting with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the K8s Kyverno Troubleshooting AI skill free?

Yes. It is published on GitHub by k8s-servant under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇