# The API scales on CPU. Stateless by construction: no local writes outside the storage # driver, no in-memory cache that changes an answer, so a new replica behaves like an old # one from its first request. apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: impuestos-api namespace: impuestos spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: impuestos-api minReplicas: 2 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: impuestos-web namespace: impuestos spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: impuestos-web minReplicas: 2 maxReplicas: 6 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70