Token导航 LogoToken导航TokenDH.com
运维和基础设施需要联网github未标认证来源可访问许可证需确认审计未展示

kubernetes_hpaKubernetes HPA 部署

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

233

周安装

10

GitHub Stars

公开资料未说明

下载量

82
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:kubernetes_hpa(Kubernetes HPA 部署)
来源仓库:https://github.com/davidcastagnetoa/skills
仓库路径:skills/kubernetes_hpa
安装命令:
npx skills add https://github.com/davidcastagnetoa/skills --skill kubernetes_hpa
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/davidcastagnetoa/skills --skill kubernetes_hpa

简介

用于配置和管理 Kubernetes 水平 Pod 自动扩缩容(HPA),适合应对流量波动场景。

  • 可分析 CPU、内存或使用指标,生成或调整 HPA 策略参数。
  • 需确保 Metrics Server 正常运行,且资源指标可被整理系统暴露。
  • 通过 npx skills add 命令从指定仓库安装,建议结合监控数据优化阈值设置。
  • 高敏感业务应设置冷却期与上限,防止频繁扩缩引发成本或性能问题。

SKILL.md

kubernetes_hpa

Skill para configurar Horizontal Pod Autoscaler (HPA) de Kubernetes que escale automaticamente los workers de los servicios de inferencia del pipeline KYC basandose en metricas custom relevantes como profundidad de cola de tareas, latencia de procesamiento y utilizacion de GPU. El escalado automatico es critico para manejar picos de demanda en verificaciones de identidad sin degradar los tiempos de respuesta por debajo del SLO de 8 segundos.

When to use

Utilizar esta skill cuando el health_monitor_agent necesite configurar o ajustar el autoescalado de los servicios del pipeline KYC. Es especialmente relevante cuando se observan aumentos de latencia bajo carga, cuando se planifican campanas de onboarding masivo, o cuando se necesita optimizar costes reduciendo replicas en horas de baja demanda.

Instructions

  1. Configurar el HPA basico con metricas de CPU y memoria para el servicio de face matching:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: face-match-hpa
  namespace: kyc-pipeline
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: face-match-service
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70
  - type: Resource
    resource:
      name: memory
      target:
        type: Utilization
        averageUtilization: 80
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 30
      policies:
      - type: Pods
        value: 2
        periodSeconds: 60
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
      - type: Pods
        value: 1
        periodSeconds: 120
  1. Desplegar Prometheus Adapter para exponer metricas custom al HPA de Kubernetes:
# prometheus-adapter-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: prometheus-adapter-config
  namespace: monitoring
data:
  config.yaml: |
    rules:
    - seriesQuery: 'kyc_verification_queue_depth{namespace="kyc-pipeline"}'
      resources:
        overrides:
          namespace: {resource: "namespace"}
          pod: {resource: "pod"}
      name:
        matches: "^(.*)$"
        as: "kyc_queue_depth"
      metricsQuery: 'sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>)'
    - seriesQuery: 'kyc_processing_latency_seconds{namespace="kyc-pipeline"}'
      resources:
        overrides:
          namespace: {resource: "namespace"}
          pod: {resource: "pod"}
      name:
        matches: "^(.*)$"
        as: "kyc_p99_latency"
      metricsQuery: 'histogram_quantile(0.99, sum(rate(<<.Series>>{<<.LabelMatchers>>}[2m])) by (le, <<.GroupBy>>))'
  1. Configurar HPA con metricas custom de cola de tareas para el servicio de OCR:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: ocr-hpa
  namespace: kyc-pipeline
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: ocr-service
  minReplicas: 2
  maxReplicas: 8
  metrics:
  - type: Pods
    pods:
      metric:
        name: kyc_queue_depth
      target:
        type: AverageValue
        averageValue: "5"   # Escalar cuando hay mas de 5 tareas en cola por pod
  - type: Pods
    pods:
      metric:
        name: kyc_p99_latency
      target:
        type: AverageValue
        averageValue: "4"   # Escalar cuando p99 > 4 segundos
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 30
      policies:
      - type: Percent
        value: 50
        periodSeconds: 60
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
      - type: Pods
        value: 1
        periodSeconds: 180
  1. Configurar HPA para el servicio de liveness detection con metrica de GPU:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: liveness-hpa
  namespace: kyc-pipeline
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: liveness-service
  minReplicas: 2
  maxReplicas: 6
  metrics:
  - type: Pods
    pods:
      metric:
        name: nvidia_gpu_utilization
      target:
        type: AverageValue
        averageValue: "75"
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 65
  1. Exponer metricas custom desde los microservicios FastAPI para que Prometheus las recolecte:
from prometheus_client import Gauge, Histogram

queue_depth = Gauge(
    "kyc_verification_queue_depth",
    "Number of pending verification tasks",
    ["service"]
)

processing_latency = Histogram(
    "kyc_processing_latency_seconds",
    "Time to process a verification request",
    ["service", "step"],
    buckets=[0.5, 1, 2, 4, 6, 8, 10, 15, 30]
)

# Actualizar en cada request
async def process_verification(request):
    queue_depth.labels(service="face_match").set(get_queue_size())
    with processing_latency.labels(service="face_match", step="inference").time():
        result = await run_inference(request)
    queue_depth.labels(service="face_match").set(get_queue_size())
    return result
  1. Configurar KEDA (Kubernetes Event-Driven Autoscaling) como alternativa avanzada para escalar basandose en la cola de Redis:
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: face-match-scaledobject
  namespace: kyc-pipeline
spec:
  scaleTargetRef:
    name: face-match-service
  minReplicaCount: 2
  maxReplicaCount: 10
  cooldownPeriod: 300
  triggers:
  - type: redis
    metadata:
      address: redis.kyc-pipeline.svc:6379
      listName: kyc:face_match:queue
      listLength: "10"
      activationListLength: "3"
  1. Implementar un dashboard de monitorizacion del HPA para el health_monitor_agent:
# Script para verificar estado del HPA
kubectl get hpa -n kyc-pipeline -o wide
kubectl describe hpa face-match-hpa -n kyc-pipeline
# Verificar metricas custom disponibles
kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq '.resources[].name'

Notes

  • Configurar el scaleDown con una ventana de estabilizacion de al menos 5 minutos (300 segundos) para evitar oscilaciones rapidas (flapping) que causan cold starts frecuentes en servicios ML donde cargar modelos toma mas de un minuto.
  • Los minReplicas para servicios criticos del pipeline (face_match, liveness, ocr) nunca deben ser menores a 2 para garantizar disponibilidad; el decision engine puede funcionar con 1 replica minima al ser stateless y ligero.
  • Monitorizar regularmente las metricas del HPA con kubectl get hpa -n kyc-pipeline y ajustar los targets segun los patrones de trafico observados; un HPA que esta constantemente al maximo de replicas indica que maxReplicas es insuficiente.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.82%
按下载量换算31

Claude

31.32%
按下载量换算26

Cursor

17.13%
按下载量换算14

Gemini CLI

8.34%
按下载量换算7

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills