From 7035567387bd62d31421e068b4d518c331d70d77 Mon Sep 17 00:00:00 2001 From: infinicaretech Date: Thu, 2 Apr 2026 19:30:53 +0000 Subject: [PATCH] Add HPA autoscaling and update PubMEDIS image to 455d984 - Remove replicas:1 override (base has 2) - Add HPA: min 2, max 5 replicas (CPU 70%, memory 80%) - Update image tag to 455d984 (OAuth pre-render fix) Co-Authored-By: Claude Opus 4.6 (1M context) --- .../pubmedis/overlays/production/hpa.yaml | 40 +++++++++++++++++++ .../overlays/production/kustomization.yaml | 12 +----- 2 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 environments/pubmedis/overlays/production/hpa.yaml diff --git a/environments/pubmedis/overlays/production/hpa.yaml b/environments/pubmedis/overlays/production/hpa.yaml new file mode 100644 index 0000000..64314d4 --- /dev/null +++ b/environments/pubmedis/overlays/production/hpa.yaml @@ -0,0 +1,40 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: pubmedis + labels: + app.kubernetes.io/name: pubmedis + app.kubernetes.io/part-of: infinicaretech +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: pubmedis + minReplicas: 2 + maxReplicas: 5 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 70 + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: 80 + behavior: + scaleUp: + stabilizationWindowSeconds: 60 + policies: + - type: Pods + value: 1 + periodSeconds: 60 + scaleDown: + stabilizationWindowSeconds: 300 + policies: + - type: Pods + value: 1 + periodSeconds: 120 diff --git a/environments/pubmedis/overlays/production/kustomization.yaml b/environments/pubmedis/overlays/production/kustomization.yaml index 2267f29..aeef7bf 100644 --- a/environments/pubmedis/overlays/production/kustomization.yaml +++ b/environments/pubmedis/overlays/production/kustomization.yaml @@ -3,16 +3,8 @@ kind: Kustomization resources: - ../../base + - hpa.yaml images: - name: 10.0.0.3:31427/gitea_admin/pubmedis - newTag: "b8d4cf6" - -patches: - - target: - kind: Deployment - name: pubmedis - patch: |- - - op: replace - path: /spec/replicas - value: 1 \ No newline at end of file + newTag: "455d984"