
Kubernetes Deployments
FreeEfficiently deploy applications to Kubernetes with best practices.
Free · Opens the source repo
What Kubernetes Deployments does
The Creating Kubernetes Deployments skill provides developers and DevOps engineers with a streamlined way to generate production-ready Kubernetes manifests. It focuses on essential Kubernetes resources such as Deployments, Services, Ingress, and more, ensuring that applications are deployed with health checks, resource limits, and security best practices in mind. This skill allows users to quickly scaffold the necessary YAML configurations to get their applications up and running in a Kubernetes environment.
With this skill, you can easily create various deployment strategies, including RollingUpdate for zero-downtime updates, Blue-Green for instant rollbacks, and Canary for gradual rollouts. Each strategy is accompanied by clear configuration examples, making it easier to implement the right approach for your application's needs. Additionally, the skill includes templates for ConfigMaps and Secrets, enabling the management of application configurations and sensitive data securely.
The skill also emphasizes the importance of resource management by providing guidelines on setting resource requests and limits for different workload types. This helps ensure that your applications run efficiently within the Kubernetes cluster. Furthermore, built-in health checks such as liveness and readiness probes are included, allowing for better monitoring and management of application health.
Whether you're a developer looking to deploy a new application or a DevOps engineer managing existing services, this skill simplifies the deployment process and adheres to Kubernetes best practices. It is particularly useful for teams aiming to maintain high availability and scalability in their applications.
When to use it
Use this skill when you need to deploy applications to Kubernetes and want to ensure production readiness with minimal effort.
When not to use it
This skill may not be suitable for users who require highly customized Kubernetes configurations beyond the provided templates.
What you can build with it
Deploying a New Application
Quickly generate the necessary Kubernetes manifests to deploy a new application with best practices.
Implementing Blue-Green Deployment
Set up a Blue-Green deployment strategy to ensure zero downtime during application updates.
Managing Application Configuration
Use ConfigMaps and Secrets to manage application settings and sensitive information securely.
How to install Kubernetes Deployments
View source1. Install with the skills CLI
npx skills add jeremylongshore/claude-code-plugins-plus-skills/creating-kubernetes-deployments --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by jeremylongshoreCreating Kubernetes Deployments
Generate production-ready Kubernetes manifests with health checks, resource limits, and security best practices.
Quick Start
Basic Deployment + Service
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-api
labels:
app: my-api
spec:
replicas: 3
selector:
matchLabels:
app: my-api
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: my-api
spec:
containers:
- name: my-api
image: my-registry/my-api:v1.0.0
ports:
- containerPort: 8080 # 8080: HTTP proxy port
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet:
path: /healthz
port: 8080 # HTTP proxy port
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /readyz
port: 8080 # HTTP proxy port
initialDelaySeconds: 5
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
name: my-api
spec:
type: ClusterIP
selector:
app: my-api
ports:
- port: 80
targetPort: 8080 # HTTP proxy port
Deployment Strategies
| Strategy | Use Case | Configuration |
|---|---|---|
| RollingUpdate | Zero-downtime updates | maxSurge: 25%, maxUnavailable: 25% |
| Recreate | Stateful apps, incompatible versions | type: Recreate |
| Blue-Green | Instant rollback | Two deployments, switch Service selector |
| Canary | Gradual rollout | Multiple deployments with weighted traffic |
Blue-Green Deployment
# Blue deployment (current production)
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-api-blue
labels:
app: my-api
version: blue
spec:
replicas: 3
selector:
matchLabels:
app: my-api
version: blue
template:
metadata:
labels:
app: my-api
version: blue
spec:
containers:
- name: my-api
image: my-registry/my-api:v1.0.0
---
# Service points to blue
apiVersion: v1
kind: Service
metadata:
name: my-api
spec:
selector:
app: my-api
version: blue # Switch to 'green' for deployment
ports:
- port: 80
targetPort: 8080 # 8080: HTTP proxy port
Service Types
| Type | Use Case | Access |
|---|---|---|
| ClusterIP | Internal services | my-api.namespace.svc.cluster.local |
| NodePort | Development, debugging | <NodeIP>:<NodePort> |
| LoadBalancer | External traffic (cloud) | Cloud provider LB IP |
| ExternalName | External service proxy | DNS CNAME |
Ingress with TLS
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-api-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName: nginx
tls:
- hosts:
- api.example.com
secretName: api-tls-secret
rules:
- host: api.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-api
port:
number: 80
Resource Limits
Always set resource requests and limits:
resources:
requests: # Guaranteed resources
cpu: 100m # 0.1 CPU core
memory: 256Mi
limits: # Maximum allowed
cpu: 500m # 0.5 CPU core
memory: 512Mi
| Workload Type | CPU Request | Memory Request | CPU Limit | Memory Limit |
|---|---|---|---|---|
| Web API | 100m-500m | 256Mi-512Mi | 500m-1000m | 512Mi-1Gi |
| Worker | 250m-1000m | 512Mi-1Gi | 1000m-2000m | 1Gi-2Gi |
| Database | 500m-2000m | 1Gi-4Gi | 2000m-4000m | 4Gi-8Gi |
Health Checks
Liveness Probe (Is container running?)
livenessProbe:
httpGet:
path: /healthz
port: 8080 # 8080: HTTP proxy port
initialDelaySeconds: 30 # Wait for app startup
periodSeconds: 10 # Check every 10s
timeoutSeconds: 5 # Timeout per check
failureThreshold: 3 # Restart after 3 failures
Readiness Probe (Ready for traffic?)
readinessProbe:
httpGet:
path: /readyz
port: 8080 # 8080: HTTP proxy port
initialDelaySeconds: 5 # Quick check after start
periodSeconds: 5 # Check every 5s
successThreshold: 1 # 1 success = ready
failureThreshold: 3 # Remove from LB after 3 failures
Startup Probe (Slow-starting apps)
startupProbe:
httpGet:
path: /healthz
port: 8080 # 8080: HTTP proxy port
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 30 # Allow 5 minutes to start (30 * 10s)
Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: my-api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-api
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
behavior:
scaleDown:
stabilizationWindowSeconds: 300 # 300: Wait 5min before scale down
ConfigMaps and Secrets
ConfigMap (Non-sensitive config)
apiVersion: v1
kind: ConfigMap
metadata:
name: my-api-config
data:
LOG_LEVEL: "info"
API_ENDPOINT: "https://api.example.com"
config.yaml: |
server:
port: 8080 # 8080: HTTP proxy port
features:
enabled: true
Secret (Sensitive data - base64 encoded)
apiVersion: v1
kind: Secret
metadata:
name: my-api-secrets
type: Opaque
data:
API_KEY: YXBpLWtleS1oZXJl # echo -n "api-key-here" | base64
DATABASE_URL: cG9zdGdyZXM6Ly8uLi4= # echo -n "postgres://..." | base64
Using in Deployment
spec:
containers:
- name: my-api
envFrom:
- configMapRef:
name: my-api-config
- secretRef:
name: my-api-secrets
volumeMounts:
- name: config-volume
mountPath: /app/config
volumes:
- name: config-volume
configMap:
name: my-api-config
Instructions
-
Gather Requirements
- Application name, container image, port
- Replica count and resource requirements
- Health check endpoints
- External access requirements (Ingress/LoadBalancer)
-
Generate Base Manifests
- Create Deployment with resource limits and probes
- Create Service (ClusterIP for internal, LoadBalancer for external)
- Add ConfigMap for configuration
- Add Secret for sensitive data
-
Add Production Features
- Configure Ingress with TLS if external access needed
- Add HPA for auto-scaling
- Add NetworkPolicy for security
- Add PodDisruptionBudget for availability
-
Validate and Apply
# Validate manifests kubectl apply -f manifests/ --dry-run=server # Apply to cluster kubectl apply -f manifests/ # Watch rollout kubectl rollout status deployment/my-api
Error Handling
See ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive troubleshooting.
| Error | Quick Fix |
|---|---|
| ImagePullBackOff | Check image name, tag, registry credentials |
| CrashLoopBackOff | Check logs: kubectl logs <pod> |
| OOMKilled | Increase memory limits |
| Pending | Check resources: kubectl describe pod <pod> |
Examples
See ${CLAUDE_SKILL_DIR}/references/examples.md for detailed walkthroughs.
Resources
- Kubernetes documentation: https://kubernetes.io/docs/
- kubectl reference: https://kubernetes.io/docs/reference/kubectl/
- Templates in
${CLAUDE_SKILL_DIR}/assets/ - Scripts in
${CLAUDE_SKILL_DIR}/scripts/
Overview
Deploy applications to Kubernetes with production-ready manifests.
Prerequisites
- Access to the Kubernetes environment or API
- Required CLI tools installed and authenticated
- Familiarity with Kubernetes concepts and terminology
Output
- Configuration files or code changes applied to the project
- Validation report confirming correct implementation
- Summary of changes made and their rationale
See Kubernetes implementation details for output format specifications.
Frequently asked questions about Kubernetes Deployments
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
