Support Lazy Loading of Pod Templates #17701
Open
+96
−33
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.
Description
There may be some circumstances where we want to change the config of the task pod, such as changing the cpu requests/limits of default task pods by editing the base YAML pod template file. In my case, I am editing something that looks like this example ConfigMap, to directly make changes to the pod templates.
However, since the code only updates
HashMap<String, PodTemplate> templates
during Overlord initialization, the changes are not immediately reflected.This PR aims to solve this problem and make Druid more adaptable in Kubernetes environments. Instead of internally keeping track of the deserialized PodTemplates we have read from all template files, we will now run the deserialization process whenever a new Task Pod is to be created. Do note this PR does not support reading from newly created pod template files. (e.g. If we create a
newPodTemplate.yaml
, we will still need to let the Overlord run template initialization for the new file to take effect).The original intention of fail-fast for invalid pod templates is retained by validating all of the pod templates defined during initialization.
Performance Considerations
Given that a ingestion task will create
n
task pods, and we havek
pod templates defined, we will be reading from the pod templaten + k
times instead of justk
times.Release note
This PR has: