Skip to content

Instantly share code, notes, and snippets.

@cardil
Last active July 18, 2025 10:36
Show Gist options
  • Save cardil/3b718ea05b2f9e8626a29630bc48f51a to your computer and use it in GitHub Desktop.
Save cardil/3b718ea05b2f9e8626a29630bc48f51a to your computer and use it in GitHub Desktop.
Paper prototype on how HPA with custom KPA scaler may look like, without changing HPA api
--- a
+++ b
+---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: php-apache
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: php-apache
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
+ - type: KPA
+ kpa:
+ name: requests_per_second
+ target:
+ type: Average
+ value: 100
+---
+apiVersion: autoscaling/v3
+kind: HorizontalPodAutoscalerConfiguration
+metadata:
+ name: kpa
+spec:
+ target:
+ metrics:
+ - KPA
+ allNamespaces: false
+ namespaces:
+ - foo
+ - bar
+ delegate:
+ scaler:
+ name: scaler-api
+ namespace: kpa
+ transport: bi-directional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment