-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweather_scaler.yaml
46 lines (46 loc) · 1.27 KB
/
weather_scaler.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: nginx
name: weather-deploy
spec:
selector:
matchLabels:
run: nginx
template:
metadata:
creationTimestamp: null
labels:
run: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: weather-scaledobject
labels:
deploymentName: weather-deploy
spec:
minReplicaCount: 1 # Minimum number of replicas KEDA will scale the resource down to.
maxReplicaCount: 6 # Holds the maximum number of replicas of the target resouce.
pollingInterval: 3 # Optional. Default: 30 seconds | will check each trigger source on every ScaledObject every 30 seconds.
cooldownPeriod: 5 # Optional. Default: 300 seconds|The period to wait after the last trigger reported active before scaling the resource back to 0.
scaleTargetRef:
name: weather-deploy
triggers:
- type: weather
metadata:
host: https://api.openweathermap.org/data/2.5/weather?q=%s&appid=%s
cityName: "CITY_NAME"
apiKey: "YOUR API KEY"
threshold: "100"
activationThreshold: "273" # 10º
preference: "Temp"
scalerIndex: "42"