Add HorizontalPodAutoscaler for Caddy #35

Open
opened 2026-07-25 19:37:19 +00:00 by lab · 0 comments
Owner

Caddy runs 2 static replicas but has no HPA. Under load spikes (e.g., DDoS, crawlers), it won't scale.

Steps

  1. Add resource requests to Caddy deployment (required for HPA)
  2. Create HPA manifest:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: caddy-hpa
  namespace: caddy
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: caddy
  minReplicas: 2
  maxReplicas: 5
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70
  1. Apply and monitor
Caddy runs 2 static replicas but has no HPA. Under load spikes (e.g., DDoS, crawlers), it won't scale. ## Steps 1. Add resource requests to Caddy deployment (required for HPA) 2. Create HPA manifest: ```yaml apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: caddy-hpa namespace: caddy spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: caddy minReplicas: 2 maxReplicas: 5 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 ``` 3. Apply and monitor
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lab/homelab#35
No description provided.