[Bug] Enable ResourceQuota by adding Resources for the health-check init container #1043
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.
Why are these changes needed?
Flyte will create
ResourceQuota
for each Kubernetes namespace. To supportResourceQuota
, each container in the namespace requires setting resource limits. However, the injected health-check init container does not specify the resource limits.Why am I using the same resource configurations for the init container as those used in the Ray container?
In Kubernetes Pod, all init containers will be executed in a sequence, one by one, and each init container must complete successfully before the next one starts. On the other hands, when all init containers complete successfully, all application containers will start in parallel, and the startup order is arbitrary.
For example, we have 3 init containers and 3 application containers. The execution order will be:
init1 -> init2 -> init3 -> app1, app2, app3
The Pod's effective request/limit for a resource is the higher of:
Example:
max(max(init1, init2, init3), sum(app1, app2, app3))
Hence, using the same resource configurations for the init container as those used in the Ray container will not waste resources.
Related issue number
Slack thread: https://ray-distributed.slack.com/archives/C02GFQ82JPM/p1681294121762329
Checks
helm install kuberay-operator kuberay/kuberay-operator --version 0.5.0
in Step 1, only the head Pod will be created in Step 3.