Add task for setting up an autoscaler for a site #302
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The autoscaler handles scaling the nginx pod (which runs php and nginx) for a particular site.
This means that we will automatically scale to more instances if the system reaches higher load. Makes it less likely for us to encounter downtime when we go live with sites.
The current utilizations are set based on the (for now hard-coded from lagoon's side) resource requests for the pod. As the pod only requests 110 Mi memory, we set the bar for scaling up very high (500% of request -> 550 Mi). We are in talks with Amazee about enabling changes to the resource requests but it is not currently possible.
The autoscaler has been deployed on canary, herlev, billund and kobenhavn.
Should this be tested by the reviewer and how?
Run the script for a site, e.g.
customizable-canary
, and verify that a horizontalpodautoscaler is created in the correct namespace.If you really want to test it, tweak the scaling metric (e.g. set
averageUtilization: 50
for thememory
-metric) to see the autoscaler in action.What are the relevant tickets?
DDFDRIFT-87