Ревью манифестов Kubernetes

Проверяет манифесты Kubernetes и Helm values: ресурсы, пробы, securityContext, теги образов, PodDisruptionBudget, стратегию выкатки. Используйте при написании или ревью K8s YAML и чартов.

DevOpsПак: DevOps85 строкkubernetes-manifest-review

Установка

Выполните одну команду — она сохранит SKILL.md в папку скиллов агента. Перезапустите агента, и он подхватит скилл сам.

Claude Code — macOS, Linux
mkdir -p ~/.claude/skills/kubernetes-manifest-review && curl -fsSL https://anymodel.org/en/skills/devops/kubernetes-manifest-review/SKILL.md -o ~/.claude/skills/kubernetes-manifest-review/SKILL.md
Codex, Cursor — macOS, Linux
mkdir -p ~/.agents/skills/kubernetes-manifest-review && curl -fsSL https://anymodel.org/en/skills/devops/kubernetes-manifest-review/SKILL.md -o ~/.agents/skills/kubernetes-manifest-review/SKILL.md
Claude Code — Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.claude\skills\kubernetes-manifest-review" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/devops/kubernetes-manifest-review/SKILL.md -UseBasicParsing -OutFile "$HOME\.claude\skills\kubernetes-manifest-review\SKILL.md"
Codex, Cursor — Windows PowerShell
New-Item -ItemType Directory -Force "$HOME\.agents\skills\kubernetes-manifest-review" | Out-Null; Invoke-WebRequest https://anymodel.org/en/skills/devops/kubernetes-manifest-review/SKILL.md -UseBasicParsing -OutFile "$HOME\.agents\skills\kubernetes-manifest-review\SKILL.md"

Другой агент: сохраните файл в его папку скиллов или дайте ему ссылку на файл: https://anymodel.org/en/skills/devops/kubernetes-manifest-review/SKILL.md

SKILL.md

Исходник

Kubernetes Manifest Review

Review Deployments, StatefulSets, Services, Ingresses and Helm values for production readiness. Read all manifests of the app together (workload, service, config, PDB, HPA, network policy) before judging any one of them.

Workflow

  1. Locate manifests (k8s/, deploy/, charts/, kustomize overlays). If Helm, render first: helm template <release> <chart> -f values.yaml.
  2. Run through the checklist and note each finding with kind/name, field path and severity.
  3. Fix with minimal edits that keep the existing structure (kustomize patches, values keys).
  4. Verify against the cluster in read-only mode (see Verification). Never kubectl apply or delete without the user's explicit confirmation, and confirm which cluster and namespace the current context points to.

Checklist

Image

  • Tag is a specific version or digest, never latest or an omitted tag.
  • imagePullPolicy matches: IfNotPresent for immutable tags, Always only if tags are mutable.
  • imagePullSecrets set for private registries.

Resources

  • Every container has resources.requests for cpu and memory, and a memory limits value. Treat a CPU limit as optional and discuss throttling with the user before adding one.
  • Memory request should be close to the limit for predictable scheduling; check the numbers against actual usage if metrics are available (kubectl top pod).
  • Set the JVM/Node heap flags relative to the memory limit.

Probes

  • readinessProbe gates traffic; livenessProbe restarts stuck processes; startupProbe protects slow starts.
  • Liveness must not depend on external services (database, other pods), otherwise an outage causes a restart storm.
  • Set sensible initialDelaySeconds, periodSeconds, timeoutSeconds, failureThreshold. Probe paths must exist in the app.

securityContext

  • Pod level: runAsNonRoot: true, runAsUser numeric, seccompProfile: {type: RuntimeDefault}, fsGroup if volumes are written.
  • Container level: allowPrivilegeEscalation: false, readOnlyRootFilesystem: true (add emptyDir mounts for /tmp and cache dirs), capabilities: {drop: ["ALL"]}.
  • No privileged: true, hostNetwork, hostPath unless the user explains why.
  • automountServiceAccountToken: false when the pod does not call the API; use a dedicated ServiceAccount.

Availability and rollout

  • replicas >= 2 for anything user-facing; spread with topologySpreadConstraints or pod anti-affinity.
  • Add a PodDisruptionBudget (minAvailable or maxUnavailable) so node drains do not take the service down.
  • Deployment strategy: RollingUpdate with maxUnavailable: 0 and maxSurge: 1 for zero-downtime; minReadySeconds if needed. StatefulSets need an update strategy that fits the data store.
  • Add a preStop sleep and terminationGracePeriodSeconds long enough to drain connections.
  • HPA targets must reference requests that exist.

Config and secrets

  • Secrets come from Secret objects or an external secret operator, not plain env: value: in the manifest.
  • Never put secret values into ConfigMaps, Helm values committed to git, or labels/annotations.
  • Mount config as files or use envFrom; changing a ConfigMap does not restart pods by itself, so check for a checksum annotation or reloader.

Networking and labels

  • Service selector matches pod labels exactly; ports and targetPort names line up.
  • Consistent app.kubernetes.io/* labels. A NetworkPolicy exists when the cluster enforces them.
  • Ingress has TLS and a sensible body-size/timeout configuration where the controller needs one.

Verification

kubectl config current-context
kubectl diff -f manifest.yaml                      # read-only, shows what would change
kubectl apply --dry-run=server -f manifest.yaml    # schema and admission check
kubectl auth can-i create deployments -n <ns>
helm lint ./chart && helm template r ./chart | kubectl apply --dry-run=server -f -

If kubeconform, kube-linter or kubescape are installed, run them and include the output summary.

Output format

Report:

  1. Findings table: severity | resource | field | problem | recommended change.
  2. The edited manifests or a diff.
  3. Results of diff and dry-run, with the cluster context used.
  4. Open questions for the user (real resource usage, expected traffic, compliance needs).

Pitfalls

  • Do not add a CPU limit or tight memory limit blindly; it can cause throttling or OOM kills. Ask for real usage data.
  • readOnlyRootFilesystem breaks apps that write to disk; test it and add writable volumes.
  • Do not change selector of an existing Deployment; the field is immutable.
  • Do not rename PVCs or StatefulSet volume templates; that orphans data.
  • Never run kubectl delete, scale 0 or rollout restart on a shared cluster without confirmation.

Source: AnyModel skills catalog · License: CC BY 4.0

Подключить через AnyModel API

Скилл работает на той модели, которую использует агент. Подключите Claude Code, Codex или Cursor к AnyModel и запускайте его на Claude, GPT, Gemini и других моделях по одному ключу — оплата за токены, без подписки.

Ещё из пака DevOps

Ревью Dockerfile

Пишет и проверяет Dockerfile: закреплённые базовые образы, multi-stage, порядок слоёв для кеша, не-root пользователь, .dockerignore. Используйте при создании или ревью Dockerfile и образов.

CI на GitHub Actions

Пишет и чинит workflow GitHub Actions: триггеры, кеш, матрицы, concurrency, минимальные permissions, секреты, SHA-пины и разбор логов. Используйте при добавлении, правке или отладке CI.

Разбор инцидента

Ведёт разбор инцидента на проде: оценка влияния, сначала стабилизация откатом или флагом, таймлайн, коммуникация, постмортем без поиска виноватых. Используйте при падении, ошибках на проде и для постмортема.

Чек-лист релиза

Проводит проверки до и после релиза: миграции, конфиг и env, флаги, обратная совместимость, мониторинг, план отката, release notes. Используйте перед выкаткой или тегом релиза.

Аудит секретов и конфигурации

Находит захардкоженные секреты и конфиг, переносит их в переменные окружения, ведёт .env.example, проверяет .gitignore и историю git. Используйте при аудите секретов или перед публикацией репозитория.