manifest: autoscaling

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2024-10-02 19:06:27 -04:00
parent 9f24cd80c1
commit 4acfeb0a93
Signed by: xe
SSH Key Fingerprint: SHA256:7EWsWanxCI427bJ0t3CA6LyqXnkPajReCxkUhbpJULU
5 changed files with 46 additions and 2 deletions

23
manifest/autoscale.yaml Normal file
View File

@ -0,0 +1,23 @@
kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
name: techaro-lol
spec:
hosts:
- techaro.lol
targetPendingRequests: 100
scaleTargetRef:
name: techaro-lol
kind: Deployment
apiVersion: apps/v1
service: techaro-lol
port: 80
replicas:
min: 0
max: 10
scaledownPeriod: 300
scalingMetric:
requestRate:
granularity: 1s
targetValue: 100
window: 1m

View File

@ -10,6 +10,10 @@ spec:
spec:
securityContext:
fsGroup: 1000
volumes:
- name: temp
persistentVolumeClaim:
claimName: techaro-lol-temp
containers:
- name: main
image: ghcr.io/xe/techaro-lol:latest
@ -24,6 +28,10 @@ spec:
envFrom:
- secretRef:
name: techaro-lol
volumeMounts:
- name: temp
mountPath: /app/.next/cache
subPath: "cache"
securityContext:
runAsUser: 1000
runAsGroup: 1000

View File

@ -18,6 +18,6 @@ spec:
path: "/"
backend:
service:
name: techaro-lol
name: keda-add-ons-http-interceptor-proxy
port:
name: http
number: 8080

View File

@ -1,7 +1,9 @@
resources:
- autoscale.yaml
- ci.yaml
- deployment.yaml
- ingress.yaml
- pvc.yaml
- secret.yaml
- service.yaml

11
manifest/pvc.yaml Normal file
View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: techaro-lol-temp
spec:
accessModes:
- ReadWriteMany
storageClassName: tigris
resources:
requests:
storage: 2Gi