
K8s Deploy
- 9 installs
- 941 repo stars
- Updated April 8, 2026
- rohitg00/kubectl-mcp-server
Helps with devops & ci/cd tasks during AI-assisted development.
About
k8s-deploy is a Claude Code skill for devops & ci/cd. It helps solo builders move faster with AI-assisted coding.
- k8s-deploy
- DevOps & CI/CD
- AI-coding skill
K8s Deploy by the numbers
- 9 all-time installs (skills.sh)
- Ranked #1,020 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/rohitg00/kubectl-mcp-server --skill k8s-deployAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 9 |
|---|---|
| repo stars | ★ 941 |
| Last updated | April 8, 2026 |
| Repository | rohitg00/kubectl-mcp-server ↗ |
What it does
Helps with devops & ci/cd tasks during AI-assisted development.
Files
Kubernetes Deployment Workflows
Comprehensive deployment strategies using kubectl-mcp-server tools, including Argo Rollouts and Flagger for progressive delivery.
When to Apply
Use this skill when:
- User mentions: "deploy", "release", "rollout", "scale", "update", "upgrade"
- Operations: creating deployments, updating images, scaling replicas
- Strategies: canary, blue-green, rolling update, recreate
- Keywords: "new version", "push to production", "traffic shifting"
Priority Rules
| Priority | Rule | Impact | Tools |
|---|---|---|---|
| 1 | Preview with template before apply | CRITICAL | template_helm_chart |
| 2 | Check existing state first | CRITICAL | get_pods, list_helm_releases |
| 3 | Use progressive delivery for prod | HIGH | rollout_* tools |
| 4 | Verify health after deployment | HIGH | get_pod_metrics, get_endpoints |
| 5 | Keep rollback revision noted | MEDIUM | get_helm_history |
| 6 | Scale incrementally | LOW | scale_deployment |
Quick Reference
| Task | Tool | Example |
|---|---|---|
| Deploy from manifest | kubectl_apply | apply_manifest(yaml, namespace) |
| Deploy with Helm | install_helm_chart | install_helm_chart(name, chart, namespace) |
| Update image | set_deployment_image | set_deployment_image(name, ns, container, image) |
| Scale replicas | scale_deployment | scale_deployment(name, ns, replicas=5) |
| Rollback | rollback_deployment | rollback_deployment(name, ns, revision=0) |
| Canary promote | rollout_promote_tool | rollout_promote_tool(name, ns) |
Standard Deployments
Deploy from Manifest
kubectl_apply(manifest_yaml, namespace)Deploy with Helm
install_helm_chart(
name="my-app",
chart="bitnami/nginx",
namespace="production",
values={"replicaCount": 3}
)Scale Deployment
scale_deployment(name, namespace, replicas=5)Rolling Update
set_deployment_image(name, namespace, container="app", image="myapp:v2")
rollout_status(name, namespace, resource_type="deployment")Progressive Delivery
Argo Rollouts (Recommended)
For canary and blue-green deployments with analysis.
List Rollouts
rollouts_list_tool(namespace)Canary Promotion
rollout_status_tool(name, namespace)
rollout_promote_tool(name, namespace)Abort Bad Release
rollout_abort_tool(name, namespace)Retry Failed Rollout
rollout_retry_tool(name, namespace)See ROLLOUTS.md for detailed Argo Rollouts workflows.
Flagger Canary
For service mesh-integrated canary releases:
flagger_canaries_list_tool(namespace)
flagger_canary_get_tool(name, namespace)Deployment Strategies
| Strategy | Use Case | Tools |
|---|---|---|
| Rolling | Standard updates | set_deployment_image, rollout_status |
| Recreate | Stateful apps | Set strategy in manifest |
| Canary | Risk mitigation | rollout_* tools |
| Blue-Green | Zero downtime | rollout_* with blue-green |
See references/STRATEGIES.md for detailed strategy comparisons.
Rollback Operations
Native Kubernetes
rollback_deployment(name, namespace, revision=0)
rollback_deployment(name, namespace, revision=2)Helm Rollback
rollback_helm_release(name, namespace, revision=1)Argo Rollouts Rollback
rollout_abort_tool(name, namespace)Health Verification
After deployment, verify health:
get_pods(namespace, label_selector="app=myapp")
get_pod_metrics(name, namespace)
get_endpoints(namespace)Multi-Cluster Deployments
Deploy to specific clusters using context:
install_helm_chart(
name="app",
chart="./charts/app",
namespace="prod",
context="production-us-east"
)
install_helm_chart(
name="app",
chart="./charts/app",
namespace="prod",
context="production-eu-west"
)Example Manifests
See examples/ for ready-to-use deployment manifests:
- examples/canary-rollout.yaml - Argo Rollouts canary
- examples/blue-green.yaml - Blue-green deployment
- examples/hpa-deployment.yaml - Deployment with HPA
Prerequisites
- Argo Rollouts: Required for
rollout_*tools
kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml- Flagger: Required for
flagger_*tools
kubectl apply -k github.com/fluxcd/flagger/kustomize/kubernetesRelated Skills
- k8s-gitops - GitOps deployments with Flux/ArgoCD
- k8s-autoscaling - Auto-scale deployments
- k8s-rollouts - Advanced progressive delivery
- k8s-helm - Helm chart operations
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: myapp-bluegreen
spec:
replicas: 3
revisionHistoryLimit: 2
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myapp:v1.0.0
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
strategy:
blueGreen:
activeService: myapp-active
previewService: myapp-preview
autoPromotionEnabled: false
scaleDownDelaySeconds: 30
prePromotionAnalysis:
templates:
- templateName: smoke-test
args:
- name: service-name
value: myapp-preview
postPromotionAnalysis:
templates:
- templateName: smoke-test
args:
- name: service-name
value: myapp-active
---
apiVersion: v1
kind: Service
metadata:
name: myapp-active
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: myapp-preview
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: smoke-test
spec:
args:
- name: service-name
metrics:
- name: smoke-test
count: 1
successCondition: result == "healthy"
provider:
job:
spec:
template:
spec:
containers:
- name: smoke-test
image: curlimages/curl:latest
command:
- sh
- -c
- |
response=$(curl -s -o /dev/null -w "%{http_code}" http://{{args.service-name}}/health)
if [ "$response" = "200" ]; then
echo "healthy"
else
echo "unhealthy"
exit 1
fi
restartPolicy: Never
backoffLimit: 0
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: myapp-canary
spec:
replicas: 5
revisionHistoryLimit: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myapp:v1.0.0
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
strategy:
canary:
steps:
- setWeight: 10
- pause: {duration: 2m}
- setWeight: 25
- pause: {duration: 2m}
- setWeight: 50
- pause: {duration: 5m}
- setWeight: 75
- pause: {duration: 5m}
canaryService: myapp-canary
stableService: myapp-stable
trafficRouting:
nginx:
stableIngress: myapp-ingress
analysis:
templates:
- templateName: success-rate
startingStep: 2
args:
- name: service-name
value: myapp-canary
---
apiVersion: v1
kind: Service
metadata:
name: myapp-stable
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: myapp-canary
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
args:
- name: service-name
metrics:
- name: success-rate
interval: 1m
successCondition: result[0] >= 0.95
failureLimit: 3
provider:
prometheus:
address: http://prometheus:9090
query: |
sum(rate(http_requests_total{service="{{args.service-name}}",status=~"2.."}[5m]))
/
sum(rate(http_requests_total{service="{{args.service-name}}"}[5m]))
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
labels:
app: myapp
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myapp:v1.0.0
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "200m"
readinessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 15
periodSeconds: 20
---
apiVersion: v1
kind: Service
metadata:
name: myapp
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
type: ClusterIP
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: myapp
minReplicas: 3
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
policies:
- type: Percent
value: 10
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: Max
Deployment Strategies Reference
Comparison of Kubernetes deployment strategies and when to use each.
Strategy Comparison
| Strategy | Downtime | Risk | Rollback | Resource Cost | Best For |
|---|---|---|---|---|---|
| Rolling | None | Medium | Fast | 1.25-1.5x | Most apps |
| Recreate | Yes | Low | Manual | 1x | Stateful apps |
| Blue-Green | None | Low | Instant | 2x | Critical apps |
| Canary | None | Lowest | Instant | 1.1-1.5x | High-traffic apps |
Rolling Update (Default)
How it works: 1. New pods created incrementally 2. Old pods terminated as new become ready 3. Controlled by maxSurge and maxUnavailable
Configuration:
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%Pros:
- Zero downtime
- Low resource overhead
- Built into Kubernetes
Cons:
- Both versions run simultaneously
- No easy rollback mid-update
- Session affinity issues possible
When to use:
- Standard stateless applications
- Services that tolerate version mixing
Recreate Strategy
How it works: 1. All existing pods terminated 2. New pods created after termination 3. Brief downtime during switch
Configuration:
spec:
strategy:
type: RecreatePros:
- Clean switch between versions
- No version mixing
- Lower resource cost
Cons:
- Causes downtime
- Slower rollout
When to use:
- Applications that cannot run multiple versions
- Databases or stateful applications
- Development environments
Blue-Green Deployment
How it works: 1. Deploy new version alongside old (green environment) 2. Run tests against green environment 3. Switch traffic instantly via service selector 4. Keep blue available for instant rollback
With Argo Rollouts:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
spec:
strategy:
blueGreen:
activeService: myapp-active
previewService: myapp-preview
autoPromotionEnabled: falsePros:
- Instant rollback
- Zero downtime
- Full testing before switch
Cons:
- 2x resource cost
- More complex setup
When to use:
- Critical production services
- Applications requiring instant rollback
- Compliance requirements
Canary Deployment
How it works: 1. Deploy new version to small percentage 2. Gradually increase traffic 3. Monitor for errors 4. Auto-rollback on failures
With Argo Rollouts:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
spec:
strategy:
canary:
steps:
- setWeight: 10
- pause: {duration: 5m}
- setWeight: 30
- pause: {duration: 5m}
- setWeight: 50
- pause: {duration: 5m}Pros:
- Lowest risk
- Real user testing
- Automatic rollback
Cons:
- Slower rollout
- Complex monitoring needed
- Version mixing during rollout
When to use:
- High-traffic applications
- Risk-sensitive deployments
- A/B testing requirements
Traffic Shifting Methods
Service Selector (Basic)
apiVersion: v1
kind: Service
spec:
selector:
app: myapp
version: v2 # Change to switch trafficIstio VirtualService
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
spec:
http:
- route:
- destination:
host: myapp
subset: v1
weight: 90
- destination:
host: myapp
subset: v2
weight: 10Argo Rollouts (Recommended)
Handles traffic shifting automatically based on analysis.
Decision Flow
Need instant rollback?
├── Yes → Blue-Green
└── No
└── High-risk deployment?
├── Yes → Canary
└── No
└── Stateful app?
├── Yes → Recreate
└── No → Rolling UpdateMCP Server Tools by Strategy
| Strategy | Primary Tools |
|---|---|
| Rolling | set_deployment_image, rollout_status |
| Recreate | kubectl_apply, get_pods |
| Blue-Green | rollout_promote_tool, rollout_abort_tool |
| Canary | rollout_status_tool, rollout_promote_tool, analysis_runs_list_tool |
Argo Rollouts Deep Dive
Detailed workflows for progressive delivery with Argo Rollouts.
Rollout Types
Canary Strategy
Gradually shift traffic to the new version:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: my-app
spec:
replicas: 5
strategy:
canary:
steps:
- setWeight: 10
- pause: {duration: 5m}
- setWeight: 25
- pause: {duration: 5m}
- setWeight: 50
- pause: {duration: 5m}
- setWeight: 75
- pause: {duration: 5m}Blue-Green Strategy
Switch all traffic at once:
strategy:
blueGreen:
activeService: my-app-active
previewService: my-app-preview
autoPromotionEnabled: false
prePromotionAnalysis:
templates:
- templateName: success-rateAnalysis Templates
Success Rate Analysis
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: success-rate
spec:
metrics:
- name: success-rate
interval: 30s
count: 5
successCondition: result[0] >= 0.95
provider:
prometheus:
address: http://prometheus:9090
query: |
sum(rate(http_requests_total{status=~"2.*",app="{{args.app}}"}[5m])) /
sum(rate(http_requests_total{app="{{args.app}}"}[5m]))MCP Server Tools
# List all rollouts
rollouts_list_tool(namespace="production")
# Get rollout details and status
rollout_get_tool(name="my-app", namespace="production")
rollout_status_tool(name="my-app", namespace="production")
# Promote (advance canary)
rollout_promote_tool(name="my-app", namespace="production")
# Abort (rollback)
rollout_abort_tool(name="my-app", namespace="production")
# Retry failed rollout
rollout_retry_tool(name="my-app", namespace="production")
# Restart rollout (new ReplicaSet)
rollout_restart_tool(name="my-app", namespace="production")
# Check analysis runs
analysis_runs_list_tool(namespace="production")Common Workflows
Safe Canary Release
1. rollout_status_tool(name, namespace) # Check current state
2. # Update image in rollout manifest
3. apply_manifest(rollout_yaml, namespace)
4. rollout_status_tool(name, namespace) # Watch progress
5. # If analysis fails: rollout_abort_tool(name, namespace)
6. # If manual gate: rollout_promote_tool(name, namespace)Emergency Rollback
rollout_abort_tool(name, namespace)
# Immediately reverts to stable versionForce Full Promotion
rollout_promote_tool(name, namespace, full=True)
# Skips remaining stepsTroubleshooting
Rollout Stuck
rollout_status_tool(name, namespace)
analysis_runs_list_tool(namespace)
get_events(namespace)Analysis Failing
analysis_runs_list_tool(namespace)
# Check Prometheus query in AnalysisTemplate
# Verify metrics are being collected