Autoscaling Configuration

作者 aj-geddes3f5182cfd739无许可证355 个星标收录于 2026年10月8日更新于 2026年10月8日仓库7个月前更新

Configure autoscaling for Kubernetes, VMs, and serverless workloads based on metrics, schedules, and custom indicators.

包含脚本DevOps & Cloud
AI 生成的概览

指导基于指标、时间表和自定义指标为 Kubernetes、虚拟机和无服务器工作负载配置自动扩缩容。

功能
提供自动扩缩容的参考指南和入门配置,涵盖 Kubernetes 水平 Pod 自动扩缩器、AWS Auto Scaling、自定义指标、监控和自动扩缩容脚本。包含一个 YAML 入门模板和一个用于检查配置的验证脚本。还列出了最佳实践,例如设置最小/最大副本数、冷却期以及使用多个指标。
适用场景
适用于设置或审查基于流量、时间表或资源利用率的自动扩缩容。适合降低成本、应对高峰负载、批处理和数据库连接池等场景。
运行要求
附带可执行验证脚本(scripts/validate-config.sh)和 YAML 入门模板。应用这些配置需要相应平台,例如 Kubernetes 集群或 AWS 账户,但技能中未指定凭据。

Autoscaling Configuration

Table of Contents

Overview

Implement autoscaling strategies to automatically adjust resource capacity based on demand, ensuring cost efficiency while maintaining performance and availability.

When to Use

  • Traffic-driven workload scaling
  • Time-based scheduled scaling
  • Resource utilization optimization
  • Cost reduction
  • High-traffic event handling
  • Batch processing optimization
  • Database connection pooling

Quick Start

Minimal working example:

yaml
# hpa-configuration.yamlapiVersion: autoscaling/v2kind: HorizontalPodAutoscalermetadata:  name: myapp-hpa  namespace: productionspec:  scaleTargetRef:    apiVersion: apps/v1    kind: Deployment    name: myapp  minReplicas: 2  maxReplicas: 20  metrics:    - type: Resource      resource:        name: cpu        target:          type: Utilization          averageUtilization: 70    - type: Resource      resource:        name: memory        target:          type: Utilization// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Kubernetes Horizontal Pod Autoscaler [blocked]Kubernetes Horizontal Pod Autoscaler
AWS Auto Scaling [blocked]AWS Auto Scaling
Custom Metrics Autoscaling [blocked]Custom Metrics Autoscaling
Autoscaling Script [blocked]Autoscaling Script
Monitoring Autoscaling [blocked]Monitoring Autoscaling

Best Practices

✅ DO

  • Set appropriate min/max replicas
  • Monitor metric aggregation window
  • Implement cooldown periods
  • Use multiple metrics
  • Test scaling behavior
  • Monitor scaling events
  • Plan for peak loads
  • Implement fallback strategies

❌ DON'T

  • Set min replicas to 1
  • Scale too aggressively
  • Ignore cooldown periods
  • Use single metric only
  • Forget to test scaling
  • Scale below resource needs
  • Neglect monitoring
  • Deploy without capacity tests

来源与署名

来源:aj-geddes/useful-ai-prompts位于skills/autoscaling-configuration提交3f5182c

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架