Agent Skills Basics
This section shows how to scope and run packaged SME skills for container and Kubernetes work - Dockerfile review, manifest lint, and incident triage - as reusable automations.
Busque em todas as páginas da documentação
This section shows how to scope and run packaged SME skills for container and Kubernetes work - Dockerfile review, manifest lint, and incident triage - as reusable automations.
docker buildx version).kubectl matched to your cluster minor (Kubernetes 1.36.2; keep the client within one minor of the API server).kube-linter and kubeconform for static manifest checks.# kubeconform: schema validation against the target K8s version
curl -sL https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz | tar xz
sudo mv kubeconform /usr/local/bin/State exactly what the skill reviews and what it ignores so it stays maintainable.
Dockerfile Review Skill: checks build cache order, base image pinning,
non-root USER, and secret leakage in the final image. It does NOT
review application code or Kubernetes manifests.Record the target minor so schema checks match the cluster.
kubeconform -kubernetes-version 1.36.2 -strict -summary deploy/-kubernetes-version validates manifests against that minor's schemas.-strict rejects unknown fields, catching typos like limts.Run a static pass before any human reads the file.
# flagged: unpinned base tag and no non-root user
FROM node:22
COPY . .
RUN npm ci
CMD ["node", "server.js"]node:22 tag is mutable; pin to a digest or patch tag for reproducibility.USER line means the container runs as root, which Pod Security rejects.npm ci busts the dependency cache on every source change.Catch absent probes and limits before the Deployment merges.
kube-linter lint deploy/ --include no-read-only-root-fs,unset-cpu-requirementskube-linter ships built-in checks for probes, limits, and root filesystems.Fail the build on fixable high-severity vulnerabilities.
trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:1.4.2--exit-code 1 turns findings into a failing CI step.Start every incident from kubectl get and describe, never from guesses.
kubectl get pod api-7d9f -o wide
kubectl describe pod api-7d9fSTATUS column names the state: CrashLoopBackOff, ImagePullBackOff, Pending.describe shows the container reason, last exit code, and recent events.Use a server-side dry run to catch admission and schema errors.
kubectl apply -f deploy/ --dry-run=server--dry-run=server runs admission webhooks and validation without persisting.Run review, lint, scan, and dry-run as ordered gates.
steps:
- run: hadolint Dockerfile
- run: docker buildx build -t myapp:$SHA .
- run: trivy image --severity HIGH,CRITICAL --exit-code 1 myapp:$SHA
- run: kubeconform -kubernetes-version 1.36.2 -strict deploy/
- run: kube-linter lint deploy/Let the cluster reject non-compliant pods so the skill and the platform agree.
apiVersion: v1
kind: Namespace
metadata:
name: payments
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/enforce-version: v1.36restricted level forbids running as root and requires dropped capabilities.enforce-version pins the policy to a Kubernetes minor, matching your skill's pin.Turn a triage decision into commands the skill runs in order.
# ImagePullBackOff branch
kubectl describe pod api-7d9f | grep -A3 Events
kubectl get events --field-selector reason=Faileddescribe events distinguish a bad tag, a missing secret, or a registry outage.reason=Failed event with "not found" points to a wrong image reference.imagePullSecret.Stack versions: This page was written for Kubernetes 1.36.2, Docker Engine 29.6.1 (BuildKit default), containerd (CRI runtime on nodes), Helm 3, Compose v2, Argo CD (latest - verify at build), and Gateway API (GA - verify controller support at build).
Revisado por Chris St. John·Última atualização: 16 de jul. de 2026