PuluhLabs
Cloud-Native Capacity Engineering

Kubernetes Pod & HPA Sizing Calculator

Kalkulasi akurat resource requests, limits, dan batas min/max replicas Horizontal Pod Autoscaler (HPA) berdasarkan target RPS. Dapatkan manifest YAML siap apply.

Parameter Beban & Pod

RPS
ms
MiB
%
2.5x
Kapasitas cadangan instan untuk menangani flash sale atau event marketing.
Total Kebutuhan CPU:60.0 vCPU Cores
Rekomendasi Baseline Replicas:121 Pods
Rentang HPA (Min - Max):85 - 303 Pods
Estimasi Worker Nodes (8 vCPU):~23 Node Server

Manifest YAML Siap Deploy

Deployment + HorizontalPodAutoscaler v2 dengan safe stabilization window

Min Replicas85
Baseline Active121
Max Auto-Scale303
# ==========================================
# Kubernetes Deployment & HPA Manifest
# Generated by PuluhLabs K8s Sizing Engine
# Target RPS: 3500 req/sec | Spike Margin: 2.5x
# ==========================================
apiVersion: apps/v1
kind: Deployment
metadata:
  name: enterprise-api-gateway
  labels:
    app.kubernetes.io/name: enterprise-api-gateway
spec:
  replicas: 121
  selector:
    matchLabels:
      app: enterprise-api-gateway
  template:
    metadata:
      labels:
        app: enterprise-api-gateway
    spec:
      containers:
        - name: app
          image: registry.puluhlabs.com/enterprise-api-gateway:latest
          resources:
            requests:
              cpu: "500m"
              memory: "384Mi"
            limits:
              cpu: "1000m"
              memory: "576Mi"
          readinessProbe:
            httpGet:
              path: /healthz
              port: 8080
            initialDelaySeconds: 5
            periodSeconds: 10
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: enterprise-api-gateway-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: enterprise-api-gateway
  minReplicas: 85
  maxReplicas: 303
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 0
      policies:
        - type: Percent
          value: 100
          periodSeconds: 15
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
        - type: Percent
          value: 10
          periodSeconds: 60

Perlu Setup Cluster K8s Berstandar Zero-Downtime?

PuluhLabs membantu setup bare-metal K8s, EKS, atau GKE dengan GitOps ArgoCD & monitoring Prometheus/Grafana.

Konsultasi DevOps

3 Jebakan Umum Autoscaling Kubernetes di Lingkungan Produksi

1. OOMKilled Akibat Memory Limits Terlalu Ketat

Aplikasi berbasis Node.js atau Java JVM memerlukan buffer alokasi memory tambahan saat Garbage Collection. Set memory limit minimal 1.5x dari memory request untuk menghindari pod di-kill oleh OS kernel.

2. Flapping Autoscaling (Scale Down Terlalu Agresif)

Tanpa konfigurasi scaleDown.stabilizationWindowSeconds: 300, pod akan terus dibuat dan dimatikan berulang kali saat fluktuasi traffic kecil, memicu degradasi cold-start latency.

3. Node Pool Exhaustion

HPA hanya menskalakan Pod. Pastikan cluster Anda memiliki Cluster Autoscaler (Karpenter di AWS atau Node Auto-provisioning di GKE) agar node fisik bertambah sebelum pod berstatus Pending.