From docker-k8s-pro
Multi-stage Docker, K8s manifests, Helm, service mesh, scaling, monitoring. Use when containerizing or deploying services.
How this skill is triggered — by the user, by Claude, or both
Slash command
/docker-k8s-pro:docker-k8s-proThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Containerize and orchestrate applications at production scale. Covers multi-stage Docker builds, Kubernetes manifests, Helm charts, service mesh, horizontal scaling, and production monitoring.
Containerize and orchestrate applications at production scale. Covers multi-stage Docker builds, Kubernetes manifests, Helm charts, service mesh, horizontal scaling, and production monitoring.
Use this when:
Use this ESPECIALLY when:
latest image tags in productionDon't skip when:
maxUnavailable: 0 is required to avoid downtime during deploys# ===== BUILDER STAGE =====
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
# ===== TEST STAGE =====
FROM builder AS tester
RUN npm run test:ci
# ===== PRODUCTION STAGE =====
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 appuser
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./
COPY --from=builder /app/node_modules ./node_modules
USER appuser
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1
CMD ["node", "server.js"]
version: '3.8'
services:
app:
build:
context: .
target: runner
ports: ["3000:3000"]
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
depends_on:
db:
condition: service_healthy
deploy:
replicas: 3
resources:
limits:
memory: 512M
cpus: '0.5'
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 5s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
labels:
app: app
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: app
template:
metadata:
labels:
app: app
spec:
containers:
- name: app
image: ghcr.io/org/app:${IMAGE_TAG}
ports:
- containerPort: 3000
envFrom:
- secretRef:
name: app-secrets
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health/live
port: 3000
initialDelaySeconds: 10
periodSeconds: 15
readinessProbe:
httpGet:
path: /health/ready
port: 3000
initialDelaySeconds: 5
periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
name: app
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 3000
selector:
app: app
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: app-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: app
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
chart/
Chart.yaml ← name, version, dependencies
values.yaml ← Default config values
values-production.yaml
templates/
deployment.yaml
service.yaml
ingress.yaml
hpa.yaml
configmap.yaml
secrets.yaml
_helpers.tpl ← Named templates
charts/ ← Subcharts (Redis, Postgres)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: app-ingress
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
nginx.ingress.kubernetes.io/rate-limit: "10r/s"
spec:
ingressClassName: nginx
tls:
- hosts:
- app.example.com
secretName: app-tls
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: app
port:
number: 80
# .github/workflows/deploy.yml (excerpt)
- name: Build & Push Docker
run: |
docker build --target=runner -t ghcr.io/${{ github.repository }}:${{ github.sha }} .
docker push ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Deploy to K8s
run: |
helm upgrade --install app ./chart \
--namespace production \
--set image.tag=${{ github.sha }} \
--values chart/values-production.yaml \
--wait --timeout 5m
/health/live, /health/ready) that probes declared in manifests will callProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub haj1t/senior-dev-squad-skills --plugin docker-k8s-pro