Add default resource requests for postgres containers #876
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.
Background
When deploying the awx-operator on some cloud providers, we noticed that sometimes the UI doesn't load properly, evidenced by 404's for assets and a blank page in the UI. What was happening is that the web container came up before the postgresql container was completely set up. This was partially resolved by adding a more specific check for the ready status of the postgresql container in another PR. But this problem was also seen as a result of the resource requests not being set for the postgresql containers.
On resource constrained clusters, k8s will give priority to containers that have explicitly requested resources. Containers that don't get squeezed, which means the container may not have enough resources to process requests, or may be terminated.
Solution
This PR also lowers the default requests for the other awx containers. This is because if the cluster does not have enough resources to satisfy the requests of all of the containers in a deployment, not all of the pods will be scheduled. Prior to this PR, our requests were unnecessarily high.
Additional Info
These changes were based on these k8s docs: https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-resource-requests-and-limits