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"