-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathkeda-scaledobject.yaml
43 lines (43 loc) · 967 Bytes
/
keda-scaledobject.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
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: postgres-auth
namespace: default
spec:
podIdentity:
provider: none
secretTargetRef:
- parameter: password
name: postgresql-dev
key: postgres-password
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: greeter-scaler
spec:
scaleTargetRef:
name: greeter
pollingInterval: 10
cooldownPeriod: 30
maxReplicaCount: 10
triggers:
- type: postgresql
metadata:
host: postgresql-dev.default.svc.cluster.local
port: "5432"
userName: postgres
dbName: postgres
sslmode: disable
query: |
SELECT MAX(value)
FROM (
SELECT value
FROM timeseries_forecast
WHERE timestamp > CURRENT_TIMESTAMP
ORDER BY timestamp
LIMIT 3
) t;
targetQueryValue: "1"
authenticationRef:
name: postgres-auth