Autoscaling Configuration

aj-geddes/useful-ai-prompts/skills/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 從公開儲存庫中收錄這些內容。

檢舉或申請下架