kyverno
БесплатноБез исполняемых скриптовНе проверенKyverno is a Kubernetes-native policy engine that validates, mutates, and generates resources and verifies image signatures using YAML policies (no Rego…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Kyverno — Kubernetes Native Policy Engine
Overview
Kyverno runs as an admission controller plus background scanner. Policies are ordinary Kubernetes resources written in YAML, with the logic in CEL expressions (the language Kubernetes itself uses for ValidatingAdmissionPolicy).
Write new policies with the CEL policy types in policies.kyverno.io/v1 (stable since 1.18). ClusterPolicy, Policy and CleanupPolicy (kyverno.io) are deprecated in 1.19 and scheduled for removal in 1.20 (estimated November 2026). Each new type has a namespaced twin (NamespacedValidatingPolicy, …) that namespace owners can manage.
| Kind (short name) | Does | Replaces ClusterPolicy rule |
|---|---|---|
ValidatingPolicy (vpol) |
Allow, audit or deny resources | validate |
MutatingPolicy (mpol) |
Patch new or existing resources | mutate |
GeneratingPolicy (gpol) |
Create or clone resources on a trigger | generate |
ImageValidatingPolicy (ivpol) |
Verify image signatures and attestations | verifyImages |
DeletingPolicy (dpol) |
Delete matching resources on a schedule | CleanupPolicy |
Instructions
Install
helm repo add kyverno https://kyverno.github.io/kyverno/ && helm repo update
# Production: three admission replicas (a single replica is fine for a test cluster)
helm install kyverno kyverno/kyverno -n kyverno --create-namespace \
--set admissionController.replicas=3 --set backgroundController.replicas=2 \
--set cleanupController.replicas=2 --set reportsController.replicas=2
# Optional: the Pod Security Standards as policies, Audit by default (more: https://kyverno.io/policies/)
helm install kyverno-policies kyverno/kyverno-policies -n kyverno --set podSecurityStandard=baseline
# CLI for local testing: package manager …
brew install kyverno # or: kubectl krew install kyverno -> kubectl kyverno
# … or a release archive, verified against the published checksums
VERSION=v1.19.1
curl -fsSLO https://github.com/kyverno/kyverno/releases/download/$VERSION/kyverno-cli_${VERSION}_linux_x86_64.tar.gz
curl -fsSLO https://github.com/kyverno/kyverno/releases/download/$VERSION/checksums.txt
sha256sum --check --ignore-missing checksums.txt # kyverno-cli_v1.19.1_linux_x86_64.tar.gz: OK
tar -xzf kyverno-cli_${VERSION}_linux_x86_64.tar.gz kyverno && install -D -m 0755 kyverno ~/.local/bin/kyverno
Validation Policies
# pod-hardening.yaml — limits required, no privileged containers, no :latest
apiVersion: policies.kyverno.io/v1
kind: ValidatingPolicy
metadata:
name: pod-hardening
spec:
validationActions: [Audit] # Audit = report only, Warn = kubectl warning, Deny = block
matchConstraints:
resourceRules:
- {apiGroups: [''], apiVersions: [v1], operations: [CREATE, UPDATE], resources: [pods]}
variables:
- name: containers
expression: object.spec.containers + object.spec.?initContainers.orValue([])
validations:
- message: Every container needs CPU and memory limits.
expression: >-
variables.containers.all(c, has(c.resources) && has(c.resources.limits)
&& 'cpu' in c.resources.limits && 'memory' in c.resources.limits)
- message: Privileged containers are not allowed.
expression: variables.containers.all(c, !c.?securityContext.?privileged.orValue(false))
- messageExpression: "'Pin a version tag or digest instead of latest: ' + variables.containers.map(c, c.image).join(', ')"
expression: variables.containers.map(c, image(c.image)).all(i, i.containsDigest() || i.tag() != 'latest')
- A policy that matches only
podsis extended automatically to Deployments, ReplicaSets, StatefulSets, DaemonSets, Jobs and CronJobs (autogen); narrow it withspec.autogen.podControllers.controllers. - Optional fields need
has()or the?operator; a missing field otherwise raises an evaluation error.image()comes from Kyverno's CEL libraries (alsoresource.Get(),http.Get()); an untagged image counts aslatest. - Background scans of existing resources are on by default (
spec.evaluation.background.enabled); results land in PolicyReports:kubectl get policyreport -A.
Mutation Policies
# pod-defaults.yaml — security defaults, default requests, pull secret for the private registry
apiVersion: policies.kyverno.io/v1
kind: MutatingPolicy
metadata:
name: pod-defaults
spec:
autogen: {podControllers: {controllers: []}} # mutate Pods only (see the note below)
matchConstraints:
resourceRules:
- {apiGroups: [''], apiVersions: [v1], operations: [CREATE], resources: [pods]}
mutations:
- patchType: ApplyConfiguration # merge-style; list entries are matched by name
applyConfiguration:
expression: >-
Object{spec: Object.spec{
securityContext: Object.spec.securityContext{
runAsNonRoot: true,
seccompProfile: Object.spec.securityContext.seccompProfile{type: "Ru
Установить kyverno в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл kyverno?
Kyverno is a Kubernetes-native policy engine that validates, mutates, and generates resources and verifies image signatures using YAML policies (no Rego required). Use when a user asks to enforce Pod security or resource limits with admission policies, inject defaults, create per-namespace NetworkPolicies or quotas, verify cosign signatures, test policies with the kyverno CLI, or migrate ClusterPolicy to ValidatingPolicy before Kyverno 1.20.
Как установить скилл kyverno?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл kyverno запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic