Logo: K8s Kyverno Troubleshooting

K8s Kyverno Troubleshooting

Organisatioun
k8s-servant
k8s-kyverno-troubleshooting

Sinn dës Skill, wann Kyverno Ressourcen op Kubernetes blockéiert, ännert oder net iwwerwaacht: "admission webhook \"validate.kyverno.svc-fail\" denied the request", "resource ... was blocked due to the following policies", "Policy ... failed" vun enger ValidatingPolicy, eng Policy, déi eigentlech blockéiere soll, awer nëmme mellt (Audit), PolicyReports mat Feeler, eng Policy, déi net Ready ass, Mutate- oder Generate-Reegelen, déi näischt maachen, UpdateRequests, déi hänke bleiwen, oder "failed calling webhook" fir kyverno, well seng Pods net lafen. Deckt ClusterPolicy a Policy (kyverno.io) an d'CEL-Policies (policies.kyverno.io) of. Ënnersicht de Problem mat kubectl get, describe, events a Logs a schléit Léisunge vir. Liest als éischt a freet, éier eppes geännert gëtt.

Iwwersiicht

Editeurk8s-servant
Repositoryk8s-skills
Skill-Nummk8s-kyverno-troubleshooting
Stären
36
Forks
7
Matgeliwwert Dateien
3
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    k8s-servant huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill K8s Kyverno Troubleshooting an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-kyverno-troubleshooting
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert K8s Kyverno Troubleshooting an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet K8s Kyverno Troubleshooting automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass K8s Kyverno Troubleshooting net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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):

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill K8s Kyverno Troubleshooting?

Sinn dës Skill, wann Kyverno Ressourcen op Kubernetes blockéiert, ännert oder net iwwerwaacht: "admission webhook \"validate.kyverno.svc-fail\" denied the request", "resource ... was blocked due to the following policies", "Policy ... failed" vun enger ValidatingPolicy, eng Policy, déi eigentlech blockéiere soll, awer nëmme mellt (Audit), PolicyReports mat Feeler, eng Policy, déi net Ready ass, Mutate- oder Generate-Reegelen, déi näischt maachen, UpdateRequests, déi hänke bleiwen, oder "failed calling webhook" fir kyverno, well seng Pods net lafen. Deckt ClusterPolicy a Policy (kyverno.io)...

Firwat K8s Kyverno Troubleshooting op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. K8s Kyverno Troubleshooting besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech K8s Kyverno Troubleshooting an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-kyverno-troubleshooting an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen K8s Kyverno Troubleshooting benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat K8s Kyverno Troubleshooting benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir K8s Kyverno Troubleshooting domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill K8s Kyverno Troubleshooting gratis?

Jo. k8s-servant huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇