diff --git a/osm-seed/templates/web/web-deployment.yaml b/osm-seed/templates/web/web-deployment.yaml index e707c28c..ffccd517 100644 --- a/osm-seed/templates/web/web-deployment.yaml +++ b/osm-seed/templates/web/web-deployment.yaml @@ -168,6 +168,8 @@ spec: - name: CGIMAP_PORT value: {{ quote 8000 }} {{- end }} + - name: PASSENGER_MAX_POOL_SIZE + value: {{ .Values.web.env.PASSENGER_MAX_POOL_SIZE | default "6" | quote }} volumeMounts: - mountPath: /dev/shm name: shared-memory diff --git a/osm-seed/templates/web/web-hpa.yaml b/osm-seed/templates/web/web-hpa.yaml index e1df7d14..82684065 100644 --- a/osm-seed/templates/web/web-hpa.yaml +++ b/osm-seed/templates/web/web-hpa.yaml @@ -11,16 +11,33 @@ spec: minReplicas: {{ .Values.web.autoscaling.minReplicas }} maxReplicas: {{ .Values.web.autoscaling.maxReplicas }} metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.web.autoscaling.cpuUtilization }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.web.autoscaling.memoryUtilization }} + {{- if .Values.web.autoscaling.cpuUtilization.enable }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.web.autoscaling.cpuUtilization.value }} + {{- end }} + {{- if .Values.web.autoscaling.memoryUtilization.enable }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.web.autoscaling.memoryUtilization.value }} + {{- end }} + behavior: + scaleUp: + stabilizationWindowSeconds: {{ .Values.web.autoscaling.behavior.scaleUp.stabilizationWindowSeconds | default 60 }} + policies: + - type: Percent + value: {{ .Values.web.autoscaling.behavior.scaleUp.policyValue | default 100 }} + periodSeconds: {{ .Values.web.autoscaling.behavior.scaleUp.periodSeconds | default 60 }} + scaleDown: + stabilizationWindowSeconds: {{ .Values.web.autoscaling.behavior.scaleDown.stabilizationWindowSeconds | default 60 }} + policies: + - type: Percent + value: {{ .Values.web.autoscaling.behavior.scaleDown.policyValue | default 50 }} + periodSeconds: {{ .Values.web.autoscaling.behavior.scaleDown.periodSeconds | default 60 }} {{- end }} diff --git a/osm-seed/values.yaml b/osm-seed/values.yaml index 1f16c379..36337ade 100644 --- a/osm-seed/values.yaml +++ b/osm-seed/values.yaml @@ -162,6 +162,7 @@ web: RAILS_STORAGE_REGION: us-east-1 RAILS_STORAGE_BUCKET: osmseed-website-bucket EXTERNAL_CGIMAP: false + PASSENGER_MAX_POOL_SIZE: 6 resources: enabled: false requests: @@ -175,11 +176,24 @@ web: nodeSelector: enabled: false autoscaling: - enabled: false + enabled: true minReplicas: 1 - maxReplicas: 3 - cpuUtilization: 60 - memoryUtilization: 60 + maxReplicas: 6 + cpuUtilization: + enable: false + value: 85 + memoryUtilization: + enable: false + value: 85 + behavior: + scaleUp: + stabilizationWindowSeconds: 60 + policyValue: 100 + periodSeconds: 60 + scaleDown: + stabilizationWindowSeconds: 60 + policyValue: 50 + periodSeconds: 60 sharedMemorySize: 256Mi livenessProbeExec: true # ====================================================================================================