diff --git a/manifest/autoscale.yaml b/manifest/autoscale.yaml new file mode 100644 index 0000000..7d1d7d3 --- /dev/null +++ b/manifest/autoscale.yaml @@ -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 \ No newline at end of file diff --git a/manifest/deployment.yaml b/manifest/deployment.yaml index 2098e9c..5cd3e63 100644 --- a/manifest/deployment.yaml +++ b/manifest/deployment.yaml @@ -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 diff --git a/manifest/ingress.yaml b/manifest/ingress.yaml index 3dafd42..8ff2d3a 100644 --- a/manifest/ingress.yaml +++ b/manifest/ingress.yaml @@ -18,6 +18,6 @@ spec: path: "/" backend: service: - name: techaro-lol + name: keda-add-ons-http-interceptor-proxy port: - name: http \ No newline at end of file + number: 8080 \ No newline at end of file diff --git a/manifest/kustomization.yaml b/manifest/kustomization.yaml index 6a30666..5cd6721 100644 --- a/manifest/kustomization.yaml +++ b/manifest/kustomization.yaml @@ -1,7 +1,9 @@ resources: + - autoscale.yaml - ci.yaml - deployment.yaml - ingress.yaml + - pvc.yaml - secret.yaml - service.yaml diff --git a/manifest/pvc.yaml b/manifest/pvc.yaml new file mode 100644 index 0000000..584b218 --- /dev/null +++ b/manifest/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: techaro-lol-temp +spec: + accessModes: + - ReadWriteMany + storageClassName: tigris + resources: + requests: + storage: 2Gi