Skip to content

Commit

Permalink
Add hpa for autoscale-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoguzman committed Feb 16, 2022
1 parent 8664fd8 commit ef17671
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions devx/autoscale-demo/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2beta1
metadata:
name: sample-app
spec:
scaleTargetRef:
# point the HPA at the sample application
# you created above
apiVersion: apps/v1
kind: Deployment
name: sample-app
# autoscale between 1 and 10 replicas
minReplicas: 1
maxReplicas: 10
metrics:
# use a "Pods" metric, which takes the average of the
# given metric across all pods controlled by the autoscaling target
- type: Pods
pods:
# use the metric that you used above: pods/http_requests
metricName: http_requests
# target 500 milli-requests per second,
# which is 1 request every two seconds
targetAverageValue: 500m
1 change: 1 addition & 0 deletions devx/autoscale-demo/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: Kustomization

resources:
- deployment.yaml
- hpa.yaml
- service.yaml

namespace: autoscale-demo

0 comments on commit ef17671

Please sign in to comment.