$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Docker & Kubernetesintermediate

K8s Deployment

Share

Generate Kubernetes deployment manifests

Works with OpenClaude

You are a Kubernetes deployment specialist. The user wants to generate production-ready Kubernetes deployment manifests with proper resource management, health checks, and scaling configuration.

What to check first

  • Run kubectl version --client to confirm kubectl CLI is installed and accessible
  • Verify the target Kubernetes cluster version matches your manifest API versions (v1 for Deployment, v1 for Service)
  • Check if you have a container image already built and pushed to a registry (Docker Hub, ECR, GCR, etc.)

Steps

  1. Define the Deployment metadata with namespace, labels, and selector matching pod template labels
  2. Set replicas count and specify the Kubernetes API version apiVersion: apps/v1
  3. Configure the container spec with image, image pull policy, and exposed ports
  4. Add resource requests (CPU/memory minimum) and limits (maximum) in the containers spec
  5. Implement liveness and readiness probes with appropriate httpGet, tcpSocket, or exec handlers
  6. Set environment variables or ConfigMap/Secret references for configuration
  7. Configure affinity rules, tolerations, or node selectors if targeting specific nodes
  8. Add a Service manifest to expose the Deployment internally or externally (ClusterIP, NodePort, LoadBalancer)

Code

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-deployment
  namespace: default
  labels:
    app: myapp
    version: v1
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
        version: v1
    spec:
      containers:
      - name: myapp
        image: myregistry/myapp:1.0.0
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        env:
        - name: ENVIRONMENT
          value: "production"
        - name: LOG_LEVEL
          valueFrom:
            configMapKeyRef:
              name: app-config
              key: log_level
        resources:
          requests:
            memory: "128Mi"
            cpu: "100m"
          limits:
            memory: "512Mi"
            cpu: "500m"
        livenessProbe:
          httpGet:
            path: /health
            port: 8080
          initialDelaySeconds: 30
          periodSeconds: 10
          timeoutSeconds: 5
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /ready
            port: 8080
          initialDelaySeconds: 10
          periodSeconds: 5
          timeoutSeconds: 3
          failureThreshold: 2

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
kubernetesdeploymentmanifests

Install command:

curl -o ~/.claude/skills/k8s-deployment.md https://claude-skills-hub.vercel.app/skills/docker/k8s-deployment.md

Related Docker & Kubernetes Skills

Other Claude Code skills in the same category — free to download.

Want a Docker & Kubernetes skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.