-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8664fd8
commit ef17671
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ kind: Kustomization | |
|
||
resources: | ||
- deployment.yaml | ||
- hpa.yaml | ||
- service.yaml | ||
|
||
namespace: autoscale-demo |