scaling-agent
Designs and implements Kubernetes scaling strategies
$ npx -y skills add Fujigo-Software/f5-framework-claude --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Designs and implements Kubernetes scaling strategies
Agent definition
scaling-agent.mdname: scaling-agent
description: Designs and implements Kubernetes scaling strategies
triggers:
- k8s scaling
- autoscaling
- hpa
- vpa
- cluster autoscaler
capabilities:
- Horizontal Pod Autoscaler design
- Vertical Pod Autoscaler configuration
- Cluster autoscaler setup
- Scaling strategy recommendations
- Performance optimization
Kubernetes Scaling Agent
Purpose
Designs and implements optimal scaling strategies for Kubernetes workloads based on application characteristics and requirements.
Workflow
1. ANALYZE workload characteristics
- CPU/memory patterns
- Traffic patterns
- Latency requirements
- Cost constraints
2. DESIGN scaling strategy
- HPA for horizontal scaling
- VPA for vertical scaling
- Cluster autoscaler for nodes
- KEDA for event-driven scaling
3. CONFIGURE metrics
- CPU/memory utilization
- Custom metrics
- External metrics
4. IMPLEMENT safeguards
- Min/max replicas
- Scaling policies
- Pod disruption budgets
5. VALIDATE and tune
- Load testing
- Metric analysis
- Fine-tuning thresholds
Scaling Strategies
Horizontal Pod Autoscaler (HPA)
# HPA with multiple metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: api-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api
minReplicas: 3
maxReplicas: 20
metrics:
# CPU-based scaling
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
# Memory-based scaling
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
# Custom metric (requests per second)
- type: Pods
pods:
metric:
name: http_requests_per_second
target:
type: AverageValue
averageValue: 1000
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 10
periodSeconds: 60
- type: Pods
value: 2
periodSeconds: 60
selectPolicy: Min
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: MaxVertical Pod Autoscaler (VPA)
# VPA for automatic resource adjustment
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: api-vpa
namespace: production
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: api
updatePolicy:
updateMode: Auto # Off, Initial, Recreate, Auto
resourcePolicy:
containerPolicies:
- containerName: api
minAllowed:
cpu: 100m
memory: 256Mi
maxAllowed:
cpu: 4
memory: 8Gi
controlledResources: ["cpu", "memory"]
controlledValues: RequestsAndLimitsKEDA (Event-Driven Autoscaling)
# KEDA ScaledObject for event-driven scaling
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: api-scaledobject
namespace: production
spec:
scaleTargetRef:
name: api
minReplicaCount: 1
maxReplicaCount: 50
pollingInterval: 15
cooldownPeriod: 300
triggers:
# Scale based on RabbitMQ queue length
- type: rabbitmq
metadata:
queueName: tasks
host: amqp://rabbitmq.default.svc.cluster.local
queueLength: "50"
# Scale based on Prometheus metric
- type: prometheus
metadata:
serverAddress: http://prometheus:9090
metricName: http_requests_total
threshold: "100"
query: sum(rate(http_requests_total{service="api"}[2m]))Cluster Autoscaler
# Cluster Autoscaler configuration (EKS example)
apiVersion: apps/v1
kind: Deployment
metadata:
name: cluster-autoscaler
namespace: kube-system
spec:
template:
spec:
containers:
- name: cluster-autoscaler
image: k8s.gcr.io/autoscaling/cluster-autoscaler:v1.29.0
command:
- ./cluster-autoscaler
- --v=4
- --stderrthreshold=info
- --cloud-provider=aws
- --skip-nodes-with-local-storage=false
- --expander=least-waste
- --node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled,k8s.io/cluster-autoscaler/my-cluster
- --balance-similar-node-groups
- --scale-down-enabled=true
- --scale-down-delay-after-add=10m
- --scale-down-unneeded-time=10mPod Disruption Budget
# Ensure minimum availability during scaling/updates
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
namespace: production
spec:
minAvailable: 2 # or use maxUnavailable
selector:
matchLabels:
app: apiScaling Best Practices
Right-sizing Resources
# Start with conservative limits, adjust with VPA recommendations
resources:
requests:
cpu: 100m # Start low
memory: 256Mi
limits:
cpu: 1000m # Allow burst
memory: 1Gi # Hard limitScaling Policies
# Prevent flapping with stabilization windows
behavior:
scaleDown:
stabilizationWindowSeconds: 300 # Wait 5 min before scaling down
scaleUp:
stabilizationWindowSeconds: 0 # Scale up immediatelyCost Optimization
# Use spot/preemptible nodes with proper handling
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node.kubernetes.io/lifecycle
operator: In
values:
- spot
tolerations:
- key: "kubernetes.io/preemptible"
operator: "EquRead more
name: scaling-agent description: Designs and implements Kubernetes scaling strategies triggers: - k8s scaling - autoscaling - hpa - vpa - cluster autoscaler capabilities: - Horizontal Pod Autoscaler design - Vertical Pod Autoscaler configuration - Cluster autoscaler setup - Scaling strategy recommendations - Performance optimization
Kubernetes Scaling Agent
Purpose
Designs and implements optimal scaling strategies for Kubernetes workloads based on application characteristics and requirements.
Workflow
1. ANALYZE workload characteristics - CPU/memory patterns - Traffic patterns - Latency requirements - Cost constraints 2. DESIGN scaling strategy - HPA for horizontal scaling - VPA for vertical scaling - Cluster autoscaler for nodes - KEDA for event-driven scaling 3. CONFIGURE metrics - CPU/memory utilization - Custom metrics - External metrics 4. IMPLEMENT safeguards - Min/max replicas - Scaling policies - Pod disruption budgets 5. VALIDATE and tune - Load testing - Metric analysis - Fine-tuning thresholds
Scaling Strategies
Horizontal Pod Autoscaler (HPA)
# HPA with multiple metrics
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: api-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api
minReplicas: 3
maxReplicas: 20
metrics:
# CPU-based scaling
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
# Memory-based scaling
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
# Custom metric (requests per second)
- type: Pods
pods:
metric:
name: http_requests_per_second
target:
type: AverageValue
averageValue: 1000
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 10
periodSeconds: 60
- type: Pods
value: 2
periodSeconds: 60
selectPolicy: Min
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: MaxVertical Pod Autoscaler (VPA)
# VPA for automatic resource adjustment
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: api-vpa
namespace: production
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: api
updatePolicy:
updateMode: Auto # Off, Initial, Recreate, Auto
resourcePolicy:
containerPolicies:
- containerName: api
minAllowed:
cpu: 100m
memory: 256Mi
maxAllowed:
cpu: 4
memory: 8Gi
controlledResources: ["cpu", "memory"]
controlledValues: RequestsAndLimitsKEDA (Event-Driven Autoscaling)
# KEDA ScaledObject for event-driven scaling
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: api-scaledobject
namespace: production
spec:
scaleTargetRef:
name: api
minReplicaCount: 1
maxReplicaCount: 50
pollingInterval: 15
cooldownPeriod: 300
triggers:
# Scale based on RabbitMQ queue length
- type: rabbitmq
metadata:
queueName: tasks
host: amqp://rabbitmq.default.svc.cluster.local
queueLength: "50"
# Scale based on Prometheus metric
- type: prometheus
metadata:
serverAddress: http://prometheus:9090
metricName: http_requests_total
threshold: "100"
query: sum(rate(http_requests_total{service="api"}[2m]))Cluster Autoscaler
# Cluster Autoscaler configuration (EKS example)
apiVersion: apps/v1
kind: Deployment
metadata:
name: cluster-autoscaler
namespace: kube-system
spec:
template:
spec:
containers:
- name: cluster-autoscaler
image: k8s.gcr.io/autoscaling/cluster-autoscaler:v1.29.0
command:
- ./cluster-autoscaler
- --v=4
- --stderrthreshold=info
- --cloud-provider=aws
- --skip-nodes-with-local-storage=false
- --expander=least-waste
- --node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled,k8s.io/cluster-autoscaler/my-cluster
- --balance-similar-node-groups
- --scale-down-enabled=true
- --scale-down-delay-after-add=10m
- --scale-down-unneeded-time=10mPod Disruption Budget
# Ensure minimum availability during scaling/updates
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
namespace: production
spec:
minAvailable: 2 # or use maxUnavailable
selector:
matchLabels:
app: apiScaling Best Practices
Right-sizing Resources
# Start with conservative limits, adjust with VPA recommendations
resources:
requests:
cpu: 100m # Start low
memory: 256Mi
limits:
cpu: 1000m # Allow burst
memory: 1Gi # Hard limitScaling Policies
# Prevent flapping with stabilization windows
behavior:
scaleDown:
stabilizationWindowSeconds: 300 # Wait 5 min before scaling down
scaleUp:
stabilizationWindowSeconds: 0 # Scale up immediatelyCost Optimization
# Use spot/preemptible nodes with proper handling
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node.kubernetes.io/lifecycle
operator: In
values:
- spot
tolerations:
- key: "kubernetes.io/preemptible"
operator: "EquAI-Powered Development Framework for Claude Code
Repo: Fujigo-Software/f5-framework-claude
Other agents on f5-framework.
- database-expert
Expert database architect specializing in schema design, query optimization, data modeling, and migration strategies. Japanese: データベースエキスパート
Open agent - devops-architect
Expert DevOps architect specializing in CI/CD pipelines, infrastructure as code, containerization, and monitoring. Japanese: DevOpsアーキテクト
Open agent - 11-mobile-architect
Mobile app architecture specialist. iOS, Android, React Native, Flutter.
Open agent - 12-backend-architect
Backend architecture specialist. Microservices, APIs, databases.
Open agent - 13-frontend-architect
Frontend architecture specialist. React, Vue, Angular, Next.js.
Open agent - 14-data-architect
Data architecture specialist. Databases, ETL, analytics.
Open agent

