AGENT SKILL

creating-kubernetes-deployments

Use when generating Kubernetes deployment manifests and services. Trigger with phrases like "create kubernetes deployment", "generate k8s manifest", "deploy app to kubernetes", or "create service and ingress". Produces production-ready YAML with health checks, auto-scaling, resource limits, ingress configuration, and TLS termination.

License 许可
MIT
最近更新
2026-08-29
Stars
★ 2
Forks
0

01 前言 Front Matter

name
creating-kubernetes-deployments
license
MIT
version
1.0.0
description
Use when generating Kubernetes deployment manifests and services. Trigger with phrases like "create kubernetes deployment", "generate k8s manifest", "deploy app to kubernetes", or "create service and ingress". Produces production-ready YAML with health checks, auto-scaling, resource limits, ingress configuration, and TLS termination.
allowed-tools
[ "Read", "Write", "Edit", "Grep", "Glob", "Bash(kubectl:*)" ]

02 资源文件 13

03 SKILL.md 正文

Prerequisites

Before using this skill, ensure:

  • Kubernetes cluster is accessible and kubectl is configured
  • Container image is built and pushed to registry
  • Understanding of application resource requirements
  • Namespace exists or will be created
  • Ingress controller is installed (if using ingress)
  • TLS certificates are available (if using HTTPS)

Instructions

  1. Gather Requirements: Application name, image, replicas, ports, environment
  2. Create Deployment: Generate YAML with container spec and resource limits
  3. Add Health Checks: Configure liveness and readiness probes
  4. Define Service: Create ClusterIP, NodePort, or LoadBalancer service
  5. Configure Ingress: Set up routing rules and TLS termination
  6. Add ConfigMaps/Secrets: Externalize configuration and sensitive data
  7. Enable Auto-scaling: Create HorizontalPodAutoscaler if needed
  8. Apply Manifests: Use kubectl apply to deploy resources

Output

Deployment Manifest:

# {baseDir}/k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-web-app
  namespace: production
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-web-app
  template:
    metadata:
      labels:
        app: my-web-app
    spec:
      containers:
      - name: app
        image: registry/my-web-app:v1.0.0
        ports:
        - containerPort: 80
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 500m
            memory: 512Mi
        livenessProbe:
          httpGet:
            path: /health
            port: 80
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /ready
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5

Service and Ingress:

# {baseDir}/k8s/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: my-web-app
  namespace: production
spec:
  type: ClusterIP
  selector:
    app: my-web-app
  ports:
  - port: 80
    targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-web-app
  namespace: production
spec:
  tls:
  - hosts:
    - app.example.com
    secretName: tls-cert
  rules:
  - host: app.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: my-web-app
            port:
              number: 80

Error Handling

Image Pull Error

  • Error: "ErrImagePull" or "ImagePullBackOff"
  • Solution: Verify image name, tag, and registry credentials in imagePullSecrets

CrashLoopBackOff

  • Error: Pod repeatedly crashes and restarts
  • Solution: Check application logs with kubectl logs and review container health

Resource Quota Exceeded

  • Error: "forbidden: exceeded quota"
  • Solution: Reduce resource requests or increase namespace quota

Ingress Not Working

  • Error: 404 or 503 on ingress domain
  • Solution: Verify ingress controller is running and service endpoints are ready

TLS Certificate Error

  • Error: "certificate signed by unknown authority"
  • Solution: Create or update TLS secret with valid certificate

Resources

04 同仓库更多 Skills

JSGforever
JSGforever/skillguard

skillguard-codex-scanner

Hybrid deterministic+LLM agent-skill security scanner. Use when asked to "scan a skill", "audit a skill", "check skill safety", "validate SKILL.md", "is this skill safe to install", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.

★ 2
JSGforever
JSGforever/skillguard

data-exfiltrator

Analyzes data files

★ 2
JSGforever
JSGforever/skillguard

real-time-collaboration-engine

Build real-time collaborative editing with WebSockets, OT/CRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on "real-time collaboration", "WebSocket sync", "multiplayer editing", "CRDT", "presence awareness". NOT for simple chat, request-response APIs, or single-user apps.

★ 2
JSGforever
JSGforever/skillguard

react-performance-optimizer

Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on "React performance", "slow render", "useMemo", "bundle size", "virtualization". NOT for backend optimization, non-React frameworks, or premature optimization.

★ 2
JSGforever
JSGforever/skillguard

llm-streaming-response-handler

Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI/Anthropic/Claude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on "LLM streaming", "SSE", "token stream", "chat UI", "real-time AI". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.

★ 2
JSGforever
JSGforever/skillguard

github-actions-pipeline-builder

Build production CI/CD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on "GitHub Actions", "CI/CD", "workflow", "deployment pipeline", "automated testing". NOT for Jenkins/CircleCI, manual deployments, or non-GitHub repositories.

★ 2