Skip to main content

This skill may not reflect the latest upstream change

Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.

DeployOfficialCertifiedAI reviewed Jul 21, 2026

k8s

We earn commissions when you shop through the links below.

Generate production-grade Kubernetes manifests — Deployments with probes and security contexts, Services, Ingress with TLS, HPA, PDB, NetworkPolicy, ConfigMaps, Secrets — with optional Helm charts, Kustomize overlays, Istio mesh, and ArgoCD GitOps

v2.0.05 installs

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install k8s
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/k8s/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are in AUTONOMOUS MODE. Do NOT ask questions. Do NOT pause for confirmation.
Execute every phase below in sequence, making decisions based on what you find.


PHASE 0 — INPUT


$ARGUMENTS may contain:

  • --helm — generate a Helm chart instead of plain manifests
  • --namespace <name> — target namespace (default: app name)
  • --replicas <n> — initial replica count (default: 2)
  • --ingress <domain> — configure ingress with this domain
  • --istio — include Istio service mesh annotations
  • --argocd — generate ArgoCD Application manifest
  • --kustomize — generate Kustomize overlays for dev/staging/prod
  • A specific resource to generate: deployment, service, ingress, hpa, configmap, secret, pdb
  • If no arguments, generate the full manifest set as plain YAML

PHASE 1 — APPLICATION ANALYSIS


Scan the project to determine Kubernetes requirements:

Container image:

  • Check for existing Dockerfile — extract EXPOSE port, HEALTHCHECK, CMD
  • If no Dockerfile, note that one is needed (reference deploy/docker skill)
  • Determine image name from: git remote URL, package.json name, go.mod module

Ports and protocols:

  • Read application config for listen port (default: 3000/8080)
  • Check for gRPC (protobuf files), WebSocket endpoints, metrics endpoint (/metrics)

Resource requirements — estimate based on stack:

  • Node.js: 128Mi-512Mi memory, 100m-500m CPU
  • Go: 64Mi-256Mi memory, 50m-250m CPU
  • Java/Spring: 512Mi-1Gi memory, 250m-1000m CPU
  • Python: 128Mi-512Mi memory, 100m-500m CPU

Dependencies:

  • Database: detected from Prisma, SQLAlchemy, GORM, etc.
  • Cache: Redis/Memcached references
  • Message queues: RabbitMQ, Kafka, NATS
  • External services: API calls, third-party integrations

Health endpoints:

  • Check for /health, /healthz, /ready, /readyz, /live, /livez
  • If none found, note to create them

Environment variables:

  • Scan for process.env., os.Getenv, os.environ references
  • Categorize as: config (ConfigMap) vs secrets (Secret)

PHASE 2 — GENERATE NAMESPACE AND RBAC


Create k8s/namespace.yml with standard Kubernetes labels:

  • app.kubernetes.io/name
  • app.kubernetes.io/managed-by: skill-deploy-k8s

Create k8s/serviceaccount.yml with matching labels.


PHASE 3 — GENERATE CORE MANIFESTS


Create all manifests in k8s/ directory (or helm/{app-name}/templates/ if --helm).

Deployment (k8s/deployment.yml):

  • apiVersion: apps/v1
  • Minimum 2 replicas for HA
  • Rolling update strategy: maxSurge: 1, maxUnavailable: 0
  • Pod anti-affinity: prefer spreading across nodes
  • Resource requests AND limits (always set both)
  • Liveness probe: HTTP GET on health endpoint, initialDelaySeconds: 15, periodSeconds: 10
  • Readiness probe: HTTP GET on ready endpoint, initialDelaySeconds: 5, periodSeconds: 5
  • Startup probe (for slow-starting apps like Java): failureThreshold: 30, periodSeconds: 10
  • terminationGracePeriodSeconds: 30
  • Security context: runAsNonRoot: true, runAsUser: 1001, fsGroup: 1001, seccompProfile: RuntimeDefault, allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities.drop: ["ALL"]
  • Environment from ConfigMap and Secret refs
  • Image pull policy: IfNotPresent for tagged, Always for latest

Service (k8s/service.yml):

  • type: ClusterIP (default — use Ingress for external access)
  • Target port matching container port
  • Named port for service mesh compatibility

Ingress (k8s/ingress.yml, if domain provided):

  • networking.k8s.io/v1
  • TLS with cert-manager annotation: cert-manager.io/cluster-issuer: letsencrypt-prod
  • nginx SSL redirect: nginx.ingress.kubernetes.io/ssl-redirect: "true"
  • Path-based routing (/ -> service)

HPA (k8s/hpa.yml):

  • autoscaling/v2
  • Min replicas: 2, Max replicas: 10
  • CPU target: 70%, Memory target: 80%
  • Scale-down stabilization: 300s (prevent flapping)
  • Scale-up stabilization: 60s
  • Scale-down policy: max 25% reduction per 60s

PodDisruptionBudget (k8s/pdb.yml):

  • minAvailable: 1 for small replica counts

ConfigMap (k8s/configmap.yml):

  • Non-sensitive configuration values extracted from env analysis

Secret (k8s/secret.yml):

  • Placeholder secret with stringData (not base64 in source)
  • Clearly marked as "REPLACE BEFORE APPLYING"

NetworkPolicy (k8s/networkpolicy.yml):

  • Default deny ingress
  • Allow ingress only from ingress controller namespace
  • Allow egress to database/cache services and DNS (kube-dns port 53)

PHASE 4 — HELM CHART (if --helm)


Generate Helm chart structure under helm/{app-name}/:

  • Chart.yaml, values.yaml, values-dev.yaml, values-staging.yaml, values-prod.yaml
  • templates/: deployment, service, ingress, hpa, pdb, configmap, secret, serviceaccount, networkpolicy, _helpers.tpl, NOTES.txt

values.yaml — parameterize all environment-specific values:

  • image.repository, image.tag, image.pullPolicy
  • replicaCount, resources.requests, resources.limits
  • ingress.enabled, ingress.hosts, ingress.tls
  • autoscaling.enabled, autoscaling.minReplicas, autoscaling.maxReplicas
  • env as key-value map

_helpers.tpl — standard helper templates: fullname, name, chart, labels, selectorLabels


PHASE 5 — KUSTOMIZE (if --kustomize)


Generate Kustomize structure under k8s/:

  • base/ with kustomization.yaml and all core manifests
  • overlays/dev/ — 1 replica, lower resources, debug logging
  • overlays/staging/ — 2 replicas, production-like resources, info logging
  • overlays/prod/ — 3+ replicas, full resources, warn logging, PDB enabled

PHASE 6 — ISTIO / SERVICE MESH (if --istio)


  • Pod annotation: sidecar.istio.io/inject: "true"
  • Namespace label: istio-injection: enabled
  • Generate VirtualService for traffic routing
  • Generate DestinationRule for connection pool settings
  • Generate PeerAuthentication for mTLS (STRICT mode)

PHASE 7 — ARGOCD (if --argocd)


Generate argocd/application.yml:

  • Source from git remote with targetRevision: HEAD
  • Path to k8s/ or helm/ directory
  • Sync policy: automated with prune and self-heal enabled

SELF-HEALING VALIDATION (max 2 iterations)


After completing deployment/infrastructure changes, validate:

  1. Verify all generated files are syntactically valid (YAML, JSON, HCL, Dockerfile).
  2. Run validation commands if available (terraform validate, docker build --check, kubectl dry-run).
  3. Verify no secrets, credentials, or sensitive values are hardcoded.
  4. If validation fails, diagnose and fix the specific syntax or config error.
  5. Repeat up to 2 iterations.

IF STILL FAILING after 2 iterations:

  • Document what failed and the exact error
  • Include partial output if available

OUTPUT


## Kubernetes Manifests Generated

### Files Created
{list all generated files with one-line descriptions}

### Resource Summary
| Resource | Name | Key Settings |
|----------|------|--------------|
| Namespace | {ns} | -- |
| Deployment | {name} | {replicas} replicas, {memory} memory |
| Service | {name} | ClusterIP, port {port} |
| Ingress | {name} | {domain}, TLS enabled |
| HPA | {name} | {min}-{max} replicas |
| PDB | {name} | minAvailable: 1 |

### Apply Commands
kubectl apply -f k8s/namespace.yml
kubectl apply -f k8s/

### Pre-Apply Checklist
- [ ] Replace placeholder secrets in k8s/secret.yml
- [ ] Verify container image is pushed to registry
- [ ] Ensure namespace exists in target cluster
- [ ] Configure cert-manager ClusterIssuer if using TLS
- [ ] Review resource limits for your workload

NEXT STEPS


  1. Build and push the container image (run deploy/docker if needed)
  2. Replace placeholder secrets with real values (or use external secrets operator)
  3. Apply manifests to a dev cluster first: kubectl apply -f k8s/ -n {namespace}
  4. Verify pods are running: kubectl get pods -n {namespace}
  5. Check probes: kubectl describe pod -n {namespace}
  6. Consider GitOps with ArgoCD or Flux for automated deployments (use --argocd)

SELF-EVOLUTION TELEMETRY


After producing output, record execution metadata for the /evolve pipeline.

Check if a project memory directory exists:

  • Look for the project path in ~/.claude/projects/
  • If found, append to skill-telemetry.md in that memory directory

Entry format:

### /k8s — {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes — what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}

Only log if the memory directory exists. Skip silently if not found.
Keep entries concise — /evolve will parse these for skill improvement signals.


DO NOT


  • Do NOT use apiVersion: extensions/v1beta1 — use current stable APIs
  • Do NOT set resource limits without requests (always set both)
  • Do NOT use latest tag in deployment manifests — use specific tags or SHA digests
  • Do NOT store real secrets in YAML files committed to git
  • Do NOT set replicas in Deployment when HPA is enabled (HPA manages replicas)
  • Do NOT use hostNetwork: true or hostPort without explicit justification
  • Do NOT use privileged: true in security context
  • Do NOT skip liveness/readiness probes — they are required for production
  • Do NOT use LoadBalancer service type without considering cost — prefer ClusterIP + Ingress
  • Do NOT overwrite existing manifests without reading them first
  • Do NOT generate manifests for services not detected in the project
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion to interfaces using modern CSS — scroll-driven animations, view transitions, @starting-style, and GPU-accelerated transforms. Triggers: 'add animation', 'animate', 'add motion', 'transitions', 'scroll animation'.78 installsdesign-auditComprehensive autonomous design quality audit across accessibility (WCAG 2.2), performance, theming, responsive/adaptive design, and anti-pattern detection. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.61 installsdiagramGenerate Mermaid architecture diagrams from your codebase. Produces C4 context and container diagrams, sequence diagrams for key flows, ER diagrams from database schemas, and module dependency graphs. Use when you need architecture diagrams, system diagrams, database ERD, sequence diagrams, dependency visualization, or C4 model diagrams.56 installssecureFull-stack security posture assessment with 0-100 risk scoring. Scans dependency vulnerabilities (npm audit, pip-audit, cargo audit, govulncheck), dangerous code patterns (SQL injection, eval, command injection, ReDoS, innerHTML, XSS vectors), authentication gaps (missing auth middleware.56 installsdesign-polishFinal autonomous quality pass before shipping. Fixes alignment, spacing, consistency, typography hierarchy, color harmony, motion timing, and every micro-detail that separates good from great..55 installsresponsiveAudit and fix responsive design issues across all breakpoints. Scans for fixed widths that cause mobile overflow, missing media query variants, non-responsive images, undersized touch targets below 48px, unreadable typography, and horizontal scroll violations..49 installs

More from Skills Hub

View source →
security-reviewSecurity audit and vulnerability assessment for any codebase. Scans for authentication bypasses, missing auth middleware, broken JWT validation (algorithm confusion, weak secrets, missing expiry), OAuth state and PKCE flaws, IDOR and horizontal privilege escalation.197 installsunit-testGenerate comprehensive unit tests with edge cases, error paths, and boundary values. Triggers: you need to add unit tests, increase code coverage, test edge cases, or verify error handling paths.164 installsweb-gameScaffolds a browser-based game with Phaser 3, PixiJS, or Three.js including game loop, asset pipeline, responsive canvas, input handling, audio, save/load, and deployment to itch.io or web. Triggers: on: "web game", "browser game", "html5 game", "phaser game", "pixi game".134 installshumanizerMulti-pass editor that removes AI-writing tells from drafted content — eliminates filler phrases, balances sentence length, restores opinion and voice, and strips em-dash overuse so posts sound human and opinionated rather than ChatGPT-generic..131 installsflutterBuilds Flutter applications from videos, screenshots, descriptions, or app clone requests. Triggers on: flutter app, build a mobile app, replicate this app in Flutter, build from video, build from screenshots, clone this app, build an app, make an app like, recreate this UI.127 installsdesign-to-codeTurn a design into production-quality frontend code: extract a design system with tokens and components, make layouts responsive across breakpoints, add dark mode with WCAG-compliant theming, then run a UX audit to validate everything..124 installs

More Deploy skills

Browse category →

Frequently asked questions about k8s

What does the k8s skill do?

Generate production-grade Kubernetes manifests — Deployments with probes and security contexts, Services, Ingress with TLS, HPA, PDB, NetworkPolicy, ConfigMaps, Secrets — with optional Helm charts, Kustomize overlays, Istio mesh, and ArgoCD GitOps It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the k8s skill?

Run `npx @skills-hub-ai/cli install k8s` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/k8s/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does k8s work with?

k8s runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the k8s skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use k8s after installing it?

In Claude Code, type `/k8s` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the k8s skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.