Skip to content
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
1 change: 1 addition & 0 deletions config/deploy/production/web-hpa.yaml.erb
1 change: 1 addition & 0 deletions config/deploy/staging/web-hpa.yaml.erb
38 changes: 38 additions & 0 deletions config/deploy/web-hpa.yaml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-hpa
labels:
app: web
environment: <%= environment %>
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web
minReplicas: <%= environment == 'production' ? 3 : 2 %>
maxReplicas: <%= environment == 'production' ? 10 : 5 %>
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 75
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 50
periodSeconds: 60
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are our web pods hitting 100% CPU? Can you check with Datadog to review what the ideal CPU usage percentage would be for scaling up?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our web pods are not hitting 100+% often, but it has happened a few times in the past month 👇

image

periodSeconds: 60
- type: Pods
value: 2
periodSeconds: 60
selectPolicy: Max
1 change: 1 addition & 0 deletions config/deploy/web.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
annotations:
shipit.shopify.io/restart: 'true'
spec:
replicas: <%= environment == 'production' ? 3 : 2 %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying a replica and HPA policy are exclusive, they will try to overwrite one another

strategy:
type: RollingUpdate
rollingUpdate:
Expand Down
Loading