Skip to content

Add behavior for Horizontal Pod Autoscaler #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions osm-seed/templates/web/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
41 changes: 29 additions & 12 deletions osm-seed/templates/web/web-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
22 changes: 18 additions & 4 deletions osm-seed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
# ====================================================================================================
Expand Down
Loading