Set resource limits for all applications
Kubernetes doesn't know how to size them to put them on nodes, so it doesn't know how to scale up. Along with that, when k8s scales down, applications should know how to gracefully shut themselves down so requests aren't dropped
Each Deployment manifest we create should have a resource block specifying at least requests, like so:
resources:
requests:
cpu: 100m
mem: 128Mi
These include:
- operationcode_backend
- operationcode_frontend
- operationcode_bot (currently defunct)
- town_crier
With docs here
Actual resource usage on a Sunday afternoon
operationcode-backend-3485932704-9kt5d 2m 435Mi
town-crier-1047233007-fgtxl 0m 49Mi
operationcode-frontend-1058172611-4jhx2 0m 52Mi
operationcode-psql-postgresql-2918048348-8q0rk 4m 54Mi
operationcode-backend-3485932704-84vnn 2m 421Mi
operationcode-bot-1758919366-rvlww 0m 52Mi
operationcode-frontend-1058172611-75gf5 0m 65Mi
operationcode-bot-1758919366-qjsp9 0m 54Mi
cloudwatch-l44t7 7m 5Mi
operationcode-redis-redis-1146509343-dr3j9 3m 12Mi
Let's do this post-migration.
What limits do we want to impose? ie 128Mi for memory and 0.1 for cpu
I added some very generic resource limits to everything (with 2 different PRs, since one PR affects the location of some of the deployments).